Skip to content

Commit

Permalink
refine test code build
Browse files Browse the repository at this point in the history
  • Loading branch information
daixtrose committed Oct 16, 2024
1 parent 56728e2 commit 67cab71
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions polymorphism/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,25 @@ FetchContent_Declare(ut
)
FetchContent_MakeAvailable(ut)

add_executable(test_consume
test_consume.cpp
add_library(polymorphism_lib
../src/consume_class_that_adheres_to_concept.cpp
../src/consume_class_with_interface.cpp
)

target_compile_features(polymorphism_lib PUBLIC cxx_std_23)
target_include_directories(polymorphism_lib PUBLIC ../include)

add_executable(test_consume
test_consume.cpp
)

target_compile_features(test_consume PUBLIC cxx_std_23)

target_include_directories(test_consume PUBLIC ../include)
target_include_directories(test_consume PUBLIC "${ut_SOURCE_DIR}")

target_link_libraries(test_consume PRIVATE polymorphism_lib)

add_test(
NAME test_consume
COMMAND test_consume
Expand Down

0 comments on commit 67cab71

Please sign in to comment.