Dont include test executable when called from Conan
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
653e54a728
commit
fa81bd59d6
|
@ -24,9 +24,11 @@ add_library(CreatureLibLibrary SHARED ${LIBRARY_SRC_FILES})
|
||||||
file(GLOB_RECURSE BATTLING_SRC_FILES "src/Battling/*.cpp" "src/Battling/*.hpp")
|
file(GLOB_RECURSE BATTLING_SRC_FILES "src/Battling/*.cpp" "src/Battling/*.hpp")
|
||||||
add_library(CreatureLibBattling SHARED ${BATTLING_SRC_FILES})
|
add_library(CreatureLibBattling SHARED ${BATTLING_SRC_FILES})
|
||||||
|
|
||||||
|
if (NOT DEFINED CONAN_EXPORTED)
|
||||||
# Create Test executable
|
# Create Test executable
|
||||||
file(GLOB_RECURSE TEST_FILES "tests/*.cpp" "tests/*.hpp")
|
file(GLOB_RECURSE TEST_FILES "tests/*.cpp" "tests/*.hpp")
|
||||||
add_executable(CreatureLibTests ${TEST_FILES} extern/catch.hpp)
|
add_executable(CreatureLibTests ${TEST_FILES} extern/catch.hpp)
|
||||||
|
endif ()
|
||||||
|
|
||||||
# Link the core library to the individual other libraries
|
# Link the core library to the individual other libraries
|
||||||
target_link_libraries(CreatureLibLibrary CreatureLibCore)
|
target_link_libraries(CreatureLibLibrary CreatureLibCore)
|
||||||
|
@ -35,8 +37,10 @@ target_link_libraries(CreatureLibBattling CreatureLibCore)
|
||||||
# Link the library data to the Battling library
|
# Link the library data to the Battling library
|
||||||
target_link_libraries(CreatureLibBattling CreatureLibLibrary)
|
target_link_libraries(CreatureLibBattling CreatureLibLibrary)
|
||||||
|
|
||||||
|
if (NOT DEFINED CONAN_EXPORTED)
|
||||||
target_link_libraries(CreatureLibTests CreatureLibLibrary)
|
target_link_libraries(CreatureLibTests CreatureLibLibrary)
|
||||||
target_link_libraries(CreatureLibTests CreatureLibBattling)
|
target_link_libraries(CreatureLibTests CreatureLibBattling)
|
||||||
|
endif ()
|
||||||
|
|
||||||
if (WINDOWS)
|
if (WINDOWS)
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64 -Wa,-mbig-obj -Wl,-allow-multiple-definition")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64 -Wa,-mbig-obj -Wl,-allow-multiple-definition")
|
||||||
|
@ -47,8 +51,10 @@ if (WINDOWS)
|
||||||
target_link_libraries(CreatureLibTests -static -static-libgcc -static-libstdc++)
|
target_link_libraries(CreatureLibTests -static -static-libgcc -static-libstdc++)
|
||||||
endif (WINDOWS)
|
endif (WINDOWS)
|
||||||
|
|
||||||
|
if (NOT DEFINED CONAN_EXPORTED)
|
||||||
# Add a definition for the test library
|
# Add a definition for the test library
|
||||||
target_compile_definitions(CreatureLibTests PRIVATE TESTS_BUILD)
|
target_compile_definitions(CreatureLibTests PRIVATE TESTS_BUILD)
|
||||||
|
endif ()
|
||||||
|
|
||||||
if (EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
|
if (EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
|
||||||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
|
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
|
||||||
|
|
Loading…
Reference in New Issue