diff options
| author | Martin Hořeňovský | 2020-04-24 21:13:04 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2020-04-24 21:13:07 +0200 |
| commit | b955355ec4e887da6a02e7649af85c594ec73c93 (patch) | |
| tree | 0da7b5a254dc3ded5c439f6e46331b9ba2494391 | |
| parent | c5ec936a72895bc3d5af81c6c2e81493f01e7a29 (diff) | |
| download | catch3-b955355ec4e887da6a02e7649af85c594ec73c93.tar.gz | |
Avoid recompiling main for each example
Instead, link against `Catch2Main` CMake target as intended.
| -rw-r--r-- | examples/CMakeLists.txt | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index ac68e664..d7c6fe93 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -42,7 +42,6 @@ set( TARGETS_IDIOMATIC_EXAMPLES ${BASENAMES_IDIOMATIC_EXAMPLES} ) foreach( name ${TARGETS_IDIOMATIC_EXAMPLES} ) add_executable( ${name} - 000-CatchMain.cpp ${EXAMPLES_DIR}/${name}.cpp ) endforeach() @@ -53,7 +52,7 @@ set(ALL_EXAMPLE_TARGETS ) foreach( name ${ALL_EXAMPLE_TARGETS} ) - target_link_libraries( ${name} Catch2 ) + target_link_libraries( ${name} Catch2 Catch2Main ) set_property(TARGET ${name} PROPERTY CXX_STANDARD 14) set_property(TARGET ${name} PROPERTY CXX_EXTENSIONS OFF) endforeach() |