Problem: Linker search path warnings on OS X

Problem:
A per-test Linker search path was added in commit a911fa4 to CMakeLists.txt as
part of fixing Windows builds. Whilst this is silently ignored by ld(1) on
Linux, it doesn't settle well with OS X. Spurious warnings are generated about
missing directories leading to convoluted build logs.

Solution:
Make per-Test LINK_DIRECTORIES() conditional for non-Apple platforms.
This commit is contained in:
hitstergtd 2016-04-19 12:20:59 +01:00
parent 136870f298
commit 846b2ba174

View File

@ -131,7 +131,10 @@ foreach(test ${tests})
# it will only link correctly for DEBUG builds in Windows (I don't know how to specify the target and target library in CMake)
SET_TARGET_PROPERTIES( ${test} PROPERTIES LINK_FLAGS "/LIBPATH:../bin/Win32/Debug/v120/dynamic" )
else()
link_directories(${test} PRIVATE "${CMAKE_SOURCE_DIR}/../lib")
# per-test directories not generated on OS X / Darwin
if (NOT APPLE)
link_directories(${test} PRIVATE "${CMAKE_SOURCE_DIR}/../lib")
endif()
endif()
if(RT_LIBRARY)