Slight tweaks to Cmake
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Deukhoofd 2019-12-31 13:58:43 +01:00
parent 48abcfcd41
commit de99a449dc
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
1 changed files with 11 additions and 8 deletions

View File

@ -26,18 +26,23 @@ conan_basic_setup()
file(GLOB_RECURSE CORE_SRC_FILES "src/*.cpp" "src/*.hpp")
add_library(pkmnLib SHARED ${CORE_SRC_FILES})
if (NOT DEFINED CONAN_EXPORTED)
# Create Test executable
file(GLOB_RECURSE TEST_FILES "tests/*.cpp" "tests/*.hpp")
add_executable(pkmnLibTests ${TEST_FILES} extern/catch.hpp)
endif ()
foreach (_variableName ${CONAN_LIBS})
message(STATUS "Lib: ${_variableName}")
endforeach()
target_link_libraries(pkmnLib ${CONAN_LIBS})
target_link_libraries(pkmnLibTests pkmnLib ${CONAN_LIBS})
if (NOT DEFINED CONAN_EXPORTED)
# Create Test executable
file(GLOB_RECURSE TEST_FILES "tests/*.cpp" "tests/*.hpp")
add_executable(pkmnLibTests ${TEST_FILES} extern/catch.hpp)
target_link_libraries(pkmnLibTests ${CONAN_LIBS} pkmnLib)
# Add a definition for the test library
target_compile_definitions(pkmnLibTests PRIVATE TESTS_BUILD)
endif ()
if (WINDOWS)
message(STATUS "Using Windows build.")
@ -47,8 +52,6 @@ if (WINDOWS)
target_link_libraries(pkmnLibTests -static -static-libgcc -static-libstdc++)
endif (WINDOWS)
# Add a definition for the test library
target_compile_definitions(pkmnLibTests PRIVATE TESTS_BUILD)