Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
.vscode/
CMakeUserPresets.json
cmake-build/
cmake-build-debug/
cmake-build-release/
cmake-build-*/
conan_provider.cmake
spectator/valid_chars.inc
venv/
15 changes: 10 additions & 5 deletions Dockerfiles/Ubuntu.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
# Use the official Ubuntu base image from Docker Hub
FROM ubuntu:latest

# Add a few required packages for building and developer tools
RUN apt-get update && apt-get install -y \
# Add a few required packages for building and developer tools. build.sh requires gcc-15, which comes from the same
# toolchain PPA that CI uses.
RUN apt-get update && apt-get install -y software-properties-common \
&& add-apt-repository -y ppa:ubuntu-toolchain-r/test \
&& apt-get update && apt-get install -y \
vim \
git \
python3 \
python3-venv \
gcc-13\
g++-13 \
gcc-15 \
g++-15 \
binutils-dev \
libiberty-dev \
cmake \
build-essential

# Create a default working directory
WORKDIR /home/ubuntu/spectator-cpp

# Copy all files & folders in the projects root directory
# Copy all files & folders in the projects root directory
# Exclude files listed in the dockerignore file
COPY ../ /home/ubuntu/spectator-cpp

Expand Down
5 changes: 3 additions & 2 deletions Dockerfiles/Ubuntu.Dockerfile.dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Ignore copying the default build folder if it exists
cmake-build/
# Ignore copying the build folders and the host's virtual environment, which the image rebuilds for Linux
cmake-build*/
venv/
13 changes: 8 additions & 5 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,15 @@ if [[ ! -f "$HOME/.conan2/profiles/default" ]]; then
conan profile detect
fi

## Modify the default profile to set the compiler version and C++ standard
## Modify the default profile to set the C++ standard, and on Linux the compiler version. On macOS, `conan profile detect`
## records the Apple clang version itself.
DEFAULT_PROFILE="$HOME/.conan2/profiles/default"
sed -i.bak -E \
-e 's/^compiler\.version=.*/compiler.version=15.2/' \
-e 's/^compiler\.cppstd=.*/compiler.cppstd=23/' \
"$DEFAULT_PROFILE"
PROFILE_EDITS=(-e 's/^compiler\.cppstd=.*/compiler.cppstd=23/')
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
# The build requires gcc-15 (checked above), and Conan accepts the major version for gcc.
PROFILE_EDITS+=(-e 's/^compiler\.version=.*/compiler.version=15/')
fi
sed -i.bak -E "${PROFILE_EDITS[@]}" "$DEFAULT_PROFILE"
rm -f "$DEFAULT_PROFILE.bak"

if [[ ! -d $BUILD_DIR ]]; then
Expand Down
Loading