mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 05:16:10 +01:00
Avoid recompiling main for each example
Instead, link against `Catch2Main` CMake target as intended.
This commit is contained in:
parent
c5ec936a72
commit
b955355ec4
@ -42,7 +42,6 @@ set( TARGETS_IDIOMATIC_EXAMPLES ${BASENAMES_IDIOMATIC_EXAMPLES} )
|
|||||||
|
|
||||||
foreach( name ${TARGETS_IDIOMATIC_EXAMPLES} )
|
foreach( name ${TARGETS_IDIOMATIC_EXAMPLES} )
|
||||||
add_executable( ${name}
|
add_executable( ${name}
|
||||||
000-CatchMain.cpp
|
|
||||||
${EXAMPLES_DIR}/${name}.cpp )
|
${EXAMPLES_DIR}/${name}.cpp )
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
@ -53,7 +52,7 @@ set(ALL_EXAMPLE_TARGETS
|
|||||||
)
|
)
|
||||||
|
|
||||||
foreach( name ${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_STANDARD 14)
|
||||||
set_property(TARGET ${name} PROPERTY CXX_EXTENSIONS OFF)
|
set_property(TARGET ${name} PROPERTY CXX_EXTENSIONS OFF)
|
||||||
endforeach()
|
endforeach()
|
||||||
|
Loading…
Reference in New Issue
Block a user