WIP C++23
This commit is contained in:
parent
3f22f888d6
commit
ab58369caf
|
|
@ -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": [
|
||||
|
|
|
|||
|
|
@ -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 ' + arg.cppstd)
|
||||
os.system('conan install /workspaces/network-experiment -of /workspaces/build -s compiler.cppstd= ' + arg.cppstd + ' -s build_type=' + args.build_type)
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ add_executable(
|
|||
|
||||
set_property(
|
||||
TARGET ${PROJECT_NAME}
|
||||
PROPERTY CXX_STANDARD 20
|
||||
PROPERTY CXX_STANDARD 23
|
||||
)
|
||||
|
||||
target_link_libraries(
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ add_executable(
|
|||
|
||||
set_property(
|
||||
TARGET ${PROJECT_NAME}
|
||||
PROPERTY CXX_STANDARD 20
|
||||
PROPERTY CXX_STANDARD 23
|
||||
)
|
||||
|
||||
target_link_libraries(
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ add_library(
|
|||
|
||||
set_property(
|
||||
TARGET ${PROJECT_NAME}
|
||||
PROPERTY CXX_STANDARD 20
|
||||
PROPERTY CXX_STANDARD 23
|
||||
)
|
||||
|
||||
target_include_directories(
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ add_library(
|
|||
|
||||
set_property(
|
||||
TARGET ${PROJECT_NAME}
|
||||
PROPERTY CXX_STANDARD 20
|
||||
PROPERTY CXX_STANDARD 23
|
||||
)
|
||||
|
||||
target_include_directories(
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ add_executable(
|
|||
|
||||
set_property(
|
||||
TARGET ${PROJECT_NAME}
|
||||
PROPERTY CXX_STANDARD 20
|
||||
PROPERTY CXX_STANDARD 23
|
||||
)
|
||||
|
||||
target_link_libraries(
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ add_library(
|
|||
|
||||
set_property(
|
||||
TARGET ${PROJECT_NAME}
|
||||
PROPERTY CXX_STANDARD 20
|
||||
PROPERTY CXX_STANDARD 23
|
||||
)
|
||||
|
||||
target_include_directories(
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ add_library(
|
|||
|
||||
set_property(
|
||||
TARGET ${PROJECT_NAME}
|
||||
PROPERTY CXX_STANDARD 20
|
||||
PROPERTY CXX_STANDARD 23
|
||||
)
|
||||
|
||||
target_include_directories(
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ add_executable(
|
|||
|
||||
set_property(
|
||||
TARGET ${PROJECT_NAME}
|
||||
PROPERTY CXX_STANDARD 20
|
||||
PROPERTY CXX_STANDARD 23
|
||||
)
|
||||
|
||||
target_link_libraries(
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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,18 @@ 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 conan install -s build_type=$BUILD_TYPE -s compiler.cppstd=$COMPILER_CPPSTD -b=* --requires=boost/1.89.0 -o without_cobalt=True
|
||||
RUN conan install -s build_type=$BUILD_TYPE -s compiler.cppstd=$COMPILER_CPPSTD -b=* --requires=libmagic/5.45
|
||||
RUN conan install -s build_type=$BUILD_TYPE -s compiler.cppstd=$COMPILER_CPPSTD -b=* --requires=freetype/2.14.1
|
||||
RUN conan install -s build_type=$BUILD_TYPE -s compiler.cppstd=$COMPILER_CPPSTD -b=missing --requires=gtest/1.14.0
|
||||
RUN conan install -s build_type=$BUILD_TYPE -s compiler.cppstd=$COMPILER_CPPSTD -b=missing --requires=libjpeg/9f
|
||||
WORKDIR /workspaces
|
||||
RUN rm -rf tmp
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue