Limit target_link_libraries to one use.
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
2af125dc03
commit
94c03cfaed
|
@ -43,26 +43,31 @@ foreach (_variableName ${CONAN_LIBS})
|
|||
message(STATUS "Lib: ${_variableName}")
|
||||
endforeach()
|
||||
|
||||
target_link_libraries(pkmnLib PUBLIC ${CONAN_LIBS})
|
||||
SET(_LINKS ${CONAN_LIBS})
|
||||
SET(_TESTLINKS pkmnLib ${CONAN_LIBS})
|
||||
|
||||
if (WINDOWS)
|
||||
message(STATUS "Using Windows build.")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64 -Wa,-mbig-obj -Wl,-allow-multiple-definition")
|
||||
# Statically link libraries we need in Windows.
|
||||
SET(_LINKS -static -static-libgcc -static-libstdc++ ${_LINKS})
|
||||
SET(_TESTLINKS -static -static-libgcc -static-libstdc++ ${_TESTLINKS})
|
||||
endif (WINDOWS)
|
||||
|
||||
|
||||
target_link_libraries(pkmnLib PUBLIC ${_LINKS})
|
||||
|
||||
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 PUBLIC ${CONAN_LIBS} pkmnLib)
|
||||
target_link_libraries(pkmnLibTests PUBLIC ${_TESTLINKS})
|
||||
|
||||
# Add a definition for the test library
|
||||
target_compile_definitions(pkmnLibTests PRIVATE TESTS_BUILD)
|
||||
endif ()
|
||||
|
||||
|
||||
if (WINDOWS)
|
||||
message(STATUS "Using Windows build.")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64 -Wa,-mbig-obj -Wl,-allow-multiple-definition")
|
||||
# Statically link libraries we need in Windows.
|
||||
target_link_libraries(pkmnLib -static -static-libgcc -static-libstdc++)
|
||||
target_link_libraries(pkmnLibTests -static -static-libgcc -static-libstdc++)
|
||||
endif (WINDOWS)
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue