Compare commits

..

2 Commits

Author SHA1 Message Date
Bart Beumer c995d75c36 WIP simplify pre-building the conan packages. 2025-12-09 23:35:22 +01:00
Bart Beumer ab58369caf WIP C++23 2025-12-09 23:05:44 +01:00
12 changed files with 26 additions and 20 deletions

View File

@ -3,10 +3,11 @@
"build": {
"dockerfile": "../devcontainer.Dockerfile",
"args": {
"BUILD_TYPE": "Debug"
"BUILD_TYPE": "Debug",
"COMPILER_CPPSTD": "23"
}
},
"postCreateCommand": "${containerWorkspaceFolder}/.devcontainer/postcreate.py --build_type=Debug",
"postCreateCommand": "${containerWorkspaceFolder}/.devcontainer/postcreate.py --build_type=Debug --cppstd=23",
// Configure tool-specific properties.
"customizations": {
"vscode": {
@ -14,6 +15,7 @@
"conan-extension.installArgs": [
"-of build",
"-s build_type=Debug"
"-s compiler.cppstd=23"
],
},
"extensions": [

View File

@ -4,7 +4,8 @@ import os
parser = argparse.ArgumentParser()
parser.add_argument('--build_type')
parser.add_argument('--cppstd')
args = parser.parse_args()
print ('Executing post-create steps. Build type ', args.build_type)
os.system('conan install /workspaces/network-experiment -of /workspaces/build -s build_type=' + args.build_type)
print ('Executing post-create steps. Build type ', args.build_type, ' C++ standard ', args.cppstd)
os.system('conan install /workspaces/network-experiment -of /workspaces/network-experiment/build -s compiler.cppstd=' + args.cppstd + ' -s build_type=' + args.build_type)

View File

@ -11,7 +11,7 @@ add_executable(
set_property(
TARGET ${PROJECT_NAME}
PROPERTY CXX_STANDARD 20
PROPERTY CXX_STANDARD 23
)
target_link_libraries(

View File

@ -10,7 +10,7 @@ add_executable(
set_property(
TARGET ${PROJECT_NAME}
PROPERTY CXX_STANDARD 20
PROPERTY CXX_STANDARD 23
)
target_link_libraries(

View File

@ -12,7 +12,7 @@ add_library(
set_property(
TARGET ${PROJECT_NAME}
PROPERTY CXX_STANDARD 20
PROPERTY CXX_STANDARD 23
)
target_include_directories(

View File

@ -9,7 +9,7 @@ add_library(
set_property(
TARGET ${PROJECT_NAME}
PROPERTY CXX_STANDARD 20
PROPERTY CXX_STANDARD 23
)
target_include_directories(

View File

@ -11,7 +11,7 @@ add_executable(
set_property(
TARGET ${PROJECT_NAME}
PROPERTY CXX_STANDARD 20
PROPERTY CXX_STANDARD 23
)
target_link_libraries(

View File

@ -11,7 +11,7 @@ add_library(
set_property(
TARGET ${PROJECT_NAME}
PROPERTY CXX_STANDARD 20
PROPERTY CXX_STANDARD 23
)
target_include_directories(

View File

@ -9,7 +9,7 @@ add_library(
set_property(
TARGET ${PROJECT_NAME}
PROPERTY CXX_STANDARD 20
PROPERTY CXX_STANDARD 23
)
target_include_directories(

View File

@ -13,7 +13,7 @@ add_executable(
set_property(
TARGET ${PROJECT_NAME}
PROPERTY CXX_STANDARD 20
PROPERTY CXX_STANDARD 23
)
target_link_libraries(

View File

@ -8,6 +8,9 @@ class HelloConan(ConanFile):
requires = "boost/1.89.0", "gtest/1.14.0", "libmagic/5.45", "freetype/2.14.1", "libjpeg/9f"
generators = "CMakeDeps"
build_policy = "*"
default_options = {
"boost/1.89.0:without_cobalt": True
}
def generate(self):
# We need to find the folder of libmagic and supply it to cmake so that

View File

@ -1,7 +1,8 @@
FROM alpine:3.21.3
# Build type used by conan. "Debug" and "Release" are supported.
ARG BUILD_TYPE=Debug
ARG BUILD_TYPE
ARG COMPILER_CPPSTD
RUN mkdir -p /root/.local/bin
ENV PATH="${PATH}:/root/.local/bin"
@ -29,18 +30,17 @@ RUN apk add --no-cache \
python3 \
pipx && \
pipx ensurepath
RUN pipx install conan && \
conan profile detect
RUN pipx install conan
RUN conan profile detect
# Pre-build some conan packages we require and take a lot of time to build. This to
# avoid expensive rebuilding everytime we need a fresh dev container..
RUN mkdir -p /workspaces/tmp
WORKDIR /workspaces/tmp
RUN conan install -s build_type=${BUILD_TYPE} -b=* --requires=boost/1.89.0
RUN conan install -s build_type=${BUILD_TYPE} -b=* --requires=libmagic/5.45
RUN conan install -s build_type=${BUILD_TYPE} -b=* --requires=freetype/2.14.1
RUN conan install -s build_type=${BUILD_TYPE} -b=missing --requires=gtest/1.14.0
RUN conan install -s build_type=${BUILD_TYPE} -b=missing --requires=libjpeg/9f
RUN touch CMakeLists.txt
ADD conanfile.py .
RUN conan install -s build_type=$BUILD_TYPE -s compiler.cppstd=$COMPILER_CPPSTD -b=*
WORKDIR /workspaces
RUN rm -rf tmp