Skip to content

Commit

Permalink
Update CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
lackhole authored Aug 3, 2024
1 parent 00a92f0 commit 1be9ab8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,15 @@ foreach(CACHE_VAR ${CACHE_VARS})
list(APPEND PREVIEW_DEFAULT_TEST_CMAKE_ARGS "-D${CACHE_VAR}${CACHE_VAR_TYPE}=${${CACHE_VAR}}")
endif()
endforeach()

# CMake somehow doesn't store CMAKE_TOOLCHAIN_FILE in cache for the first run
if (NOT ("${CMAKE_TOOLCHAIN_FILE}" STREQUAL ""))
string(FIND "${PREVIEW_DEFAULT_TEST_CMAKE_ARGS}" "CMAKE_TOOLCHAIN_FILE" index)
if (index EQUAL -1)
list(APPEND PREVIEW_DEFAULT_TEST_CMAKE_ARGS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
endif ()
endif ()

message("PREVIEW_DEFAULT_TEST_CMAKE_ARGS: ${PREVIEW_DEFAULT_TEST_CMAKE_ARGS}")

# Create test targets per supported C++ version
Expand Down

0 comments on commit 1be9ab8

Please sign in to comment.