0
0

Simplify main CMakeLists.txt

This commit is contained in:
Pcornat 2024-01-17 21:05:04 +01:00
parent a892885241
commit 38004618a6
Signed by: Pcornat
GPG Key ID: E0326CC678A00BDD
2 changed files with 12 additions and 6 deletions

View File

@ -44,8 +44,7 @@ endif ()
add_executable(AdventOfCode2023 main.cpp) add_executable(AdventOfCode2023 main.cpp)
add_library(pb_1 STATIC pb_1/problem_1.cpp pb_1/problem_1.hpp) add_subdirectory(pb_1)
set_target_properties(AdventOfCode2023 pb_1 PROPERTIES set_target_properties(AdventOfCode2023 pb_1 PROPERTIES
CXX_STANDARD 20 CXX_STANDARD 20
@ -56,13 +55,9 @@ set_target_properties(AdventOfCode2023 pb_1 PROPERTIES
) )
target_compile_definitions(AdventOfCode2023 PUBLIC $<$<AND:$<CONFIG:Debug>,$<STREQUAL:$<CXX_COMPILER_ID>,GNU>>:_GLIBCXX_DEBUG>) target_compile_definitions(AdventOfCode2023 PUBLIC $<$<AND:$<CONFIG:Debug>,$<STREQUAL:$<CXX_COMPILER_ID>,GNU>>:_GLIBCXX_DEBUG>)
target_compile_definitions(pb_1 PUBLIC $<$<AND:$<CONFIG:Debug>,$<STREQUAL:$<CXX_COMPILER_ID>,GNU>>:_GLIBCXX_DEBUG>)
target_compile_options(AdventOfCode2023 PUBLIC ${COMPILE_FLAGS}) target_compile_options(AdventOfCode2023 PUBLIC ${COMPILE_FLAGS})
target_compile_options(pb_1 PUBLIC ${COMPILE_FLAGS})
target_link_options(AdventOfCode2023 PUBLIC ${LINKER_OPTIONS}) target_link_options(AdventOfCode2023 PUBLIC ${LINKER_OPTIONS})
target_link_options(pb_1 PUBLIC ${LINKER_OPTIONS})
target_link_libraries(AdventOfCode2023 PUBLIC pb_1 ${LINKER_FLAGS}) target_link_libraries(AdventOfCode2023 PUBLIC pb_1 ${LINKER_FLAGS})
target_link_libraries(pb_1 PUBLIC ${LINKER_FLAGS})

11
pb_1/CMakeLists.txt Normal file
View File

@ -0,0 +1,11 @@
project(pb1 CXX)
add_library(pb_1 STATIC problem_1.cpp problem_1.hpp)
target_compile_definitions(pb_1 PUBLIC $<$<AND:$<CONFIG:Debug>,$<STREQUAL:$<CXX_COMPILER_ID>,GNU>>:_GLIBCXX_DEBUG>)
target_compile_options(pb_1 PUBLIC ${COMPILE_FLAGS})
target_link_options(pb_1 PUBLIC ${LINKER_OPTIONS})
target_link_libraries(pb_1 PUBLIC ${LINKER_FLAGS})