mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-25 23:06:10 +01:00
Fix running the tests with shared library on Windows.
Without this fix, the test executable fails because it can not find the dll of Catch2.
This commit is contained in:
parent
2b0fd854e2
commit
997a7d4165
@ -146,6 +146,12 @@ include(CTest)
|
|||||||
|
|
||||||
add_executable(SelfTest ${TEST_SOURCES})
|
add_executable(SelfTest ${TEST_SOURCES})
|
||||||
target_link_libraries(SelfTest PRIVATE Catch2WithMain)
|
target_link_libraries(SelfTest PRIVATE Catch2WithMain)
|
||||||
|
if (BUILD_SHARED_LIBS AND WIN32)
|
||||||
|
add_custom_command(TARGET SelfTest PRE_LINK
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:Catch2>
|
||||||
|
$<TARGET_FILE:Catch2WithMain> $<TARGET_FILE_DIR:SelfTest>
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
if (CATCH_ENABLE_COVERAGE)
|
if (CATCH_ENABLE_COVERAGE)
|
||||||
set(ENABLE_COVERAGE ON CACHE BOOL "Enable coverage build." FORCE)
|
set(ENABLE_COVERAGE ON CACHE BOOL "Enable coverage build." FORCE)
|
||||||
|
Loading…
Reference in New Issue
Block a user