diff options
author | Timothy Flynn <trflynn89@pm.me> | 2023-02-01 08:42:31 -0500 |
---|---|---|
committer | Tim Flynn <trflynn89@pm.me> | 2023-02-01 12:28:02 -0500 |
commit | 38b0b32bb4219a1c58ab7a0685c61146d1c2fc25 (patch) | |
tree | 396079663963ecd2b334331612e52a293291d7bf /Meta | |
parent | 1bbd889f67c6a5bd30eb8d169275087fde032d73 (diff) | |
download | serenity-38b0b32bb4219a1c58ab7a0685c61146d1c2fc25.zip |
Meta: Set LD_LIBRARY_PATH to Build/lagom for Lagom test targets
Some tests, such as those under LibGL, try to load shared libraries at
runtime which are stored in Build/lagom. Because all tests' working
directory is that of their CMakeLists.txt file, they fail to find those
shared libraries at runtime.
Set LD_LIBRARY_PATH to Build/lagom so the tests may find the shared
libraries. This fixes, for example, both of these commands:
./Meta/serenity.sh test lagom TestAPI
./Meta/serenity.sh run lagom TestAPI
Diffstat (limited to 'Meta')
-rw-r--r-- | Meta/Lagom/CMakeLists.txt | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Meta/Lagom/CMakeLists.txt b/Meta/Lagom/CMakeLists.txt index 99ffc6db44..f22e0d63cd 100644 --- a/Meta/Lagom/CMakeLists.txt +++ b/Meta/Lagom/CMakeLists.txt @@ -258,6 +258,7 @@ function(lagom_test source) WORKING_DIRECTORY ${LAGOM_TEST_WORKING_DIRECTORY} ) set_target_properties(${name} PROPERTIES LAGOM_WORKING_DIRECTORY "${LAGOM_TEST_WORKING_DIRECTORY}") + set_tests_properties(${name} PROPERTIES ENVIRONMENT "LD_LIBRARY_PATH=${PROJECT_BINARY_DIR}") endfunction() function(serenity_test test_src sub_dir) @@ -693,7 +694,10 @@ endif() if (NOT "$ENV{LAGOM_TARGET}" STREQUAL "") add_custom_target(run-lagom-target - COMMAND "${CMAKE_COMMAND}" -E env "SERENITY_SOURCE_DIR=${SERENITY_PROJECT_ROOT}" "$<TARGET_FILE:$ENV{LAGOM_TARGET}>" $ENV{LAGOM_ARGS} + COMMAND "${CMAKE_COMMAND}" + -E env "SERENITY_SOURCE_DIR=${SERENITY_PROJECT_ROOT}" "LD_LIBRARY_PATH=${PROJECT_BINARY_DIR}" + "$<TARGET_FILE:$ENV{LAGOM_TARGET}>" $ENV{LAGOM_ARGS} + WORKING_DIRECTORY "$<TARGET_PROPERTY:$ENV{LAGOM_TARGET},LAGOM_WORKING_DIRECTORY>" DEPENDS "$<TARGET_FILE:$ENV{LAGOM_TARGET}>" USES_TERMINAL |