1
0
Fork 0

Test suite: add GPerfTools and system SQLite linking fixes

If GPerfTools and/or the SYSTEM_SQLITE options are enabled, the test
suite fails to build (GPerfTools is not linked explicitly in CMakeLists.txt,
but becomes required by SimGear, so the linker failes with an "undefined
reference" error; the SQLite library the test suite links against is always
hardcoded to the FG-provided one).

This patch adds the GPerfTools library to the target link libraries
(if the profiler is enabled) and links to the system SQLite library
whenever SYSTEM_SQLITE is enabled.
This commit is contained in:
Alessandro Menti 2017-03-26 12:10:15 +02:00
parent 27baca4826
commit 7db8ed17c4
No known key found for this signature in database
GPG key ID: 467AC0B4D6A6F336

View file

@ -90,6 +90,10 @@ set_target_properties (fgtestlib
COMPILE_DEFINITIONS "FG_TESTLIB" COMPILE_DEFINITIONS "FG_TESTLIB"
) )
if(FG_HAVE_GPERFTOOLS)
include_directories(${GooglePerfTools_INCLUDE_DIR})
target_link_libraries(fgtestlib ${GooglePerfTools_LIBRARIES})
endif()
target_link_libraries(fgtestlib SimGearCore ${PLATFORM_LIBS}) target_link_libraries(fgtestlib SimGearCore ${PLATFORM_LIBS})
add_executable(fgtest fgTestDriver.cxx) add_executable(fgtest fgTestDriver.cxx)
@ -97,9 +101,9 @@ target_link_libraries(fgtest fgtestlib)
# repeat this section for each unit-test executable # repeat this section for each unit-test executable
add_executable(testnavs test_navaids2.cxx) add_executable(testnavs test_navaids2.cxx)
target_link_libraries(testnavs fgtestlib fgsqlite3) target_link_libraries(testnavs fgtestlib ${SQLITE3_LIBRARY})
add_test(testnavs ${EXECUTABLE_OUTPUT_PATH}/testnavs) add_test(testnavs ${EXECUTABLE_OUTPUT_PATH}/testnavs)
add_executable(testflightplan test_flightplan.cxx) add_executable(testflightplan test_flightplan.cxx)
target_link_libraries(testflightplan fgtestlib fgsqlite3) target_link_libraries(testflightplan fgtestlib ${SQLITE3_LIBRARY})
add_test(testflightplan ${EXECUTABLE_OUTPUT_PATH}/testflightplan) add_test(testflightplan ${EXECUTABLE_OUTPUT_PATH}/testflightplan)