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:
parent
27baca4826
commit
7db8ed17c4
1 changed files with 6 additions and 2 deletions
|
@ -90,6 +90,10 @@ set_target_properties (fgtestlib
|
|||
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})
|
||||
|
||||
add_executable(fgtest fgTestDriver.cxx)
|
||||
|
@ -97,9 +101,9 @@ target_link_libraries(fgtest fgtestlib)
|
|||
|
||||
# repeat this section for each unit-test executable
|
||||
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_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)
|
||||
|
|
Loading…
Reference in a new issue