Skip to content

Commit 55abcb5

Browse files
hitgilHitgirl
andauthored
Fix #4863: skip try_run for LIBCPP_VERSION_OUTPUT during cross compil… (#4876)
* Fix #4863: skip try_run for LIBCPP_VERSION_OUTPUT during cross compilation Signed-off-by: Hitgirl <[email protected]> * fix #4863: handle cross-compiling in libc++ detection gracefully Signed-off-by: Hitgirl <[email protected]> * refactor: move cross-compiling check before cached output detection Signed-off-by: Hitgirl <[email protected]> * refactor: move cross-compiling check before cached output detection Signed-off-by: Hitgirl <[email protected]> * refactor: move cross-compiling check before cached output detection Signed-off-by: Hitgirl <[email protected]> --------- Signed-off-by: Hitgirl <[email protected]> Co-authored-by: Hitgirl <[email protected]>
1 parent c637a8b commit 55abcb5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cmake/download_test_data.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,14 @@ string(REGEX REPLACE "[ ]*\n" "; " CXX_VERSION_RESULT "${CXX_VERSION_RESULT}")
6868
message(STATUS "Compiler: ${CXX_VERSION_RESULT}")
6969

7070
# determine used C++ standard library (for debug and support purposes)
71+
if(CMAKE_CROSSCOMPILING)
72+
set(LIBCPP_VERSION_OUTPUT_CACHED "could not be detected due to cross-compiling" CACHE STRING "Detected C++ standard library version")
73+
endif()
7174
if(NOT DEFINED LIBCPP_VERSION_OUTPUT_CACHED)
7275
try_run(RUN_RESULT_VAR COMPILE_RESULT_VAR
7376
"${CMAKE_BINARY_DIR}" SOURCES "${CMAKE_SOURCE_DIR}/cmake/detect_libcpp_version.cpp"
74-
RUN_OUTPUT_VARIABLE LIBCPP_VERSION_OUTPUT COMPILE_OUTPUT_VARIABLE LIBCPP_VERSION_COMPILE_OUTPUT
77+
RUN_OUTPUT_VARIABLE LIBCPP_VERSION_OUTPUT
78+
COMPILE_OUTPUT_VARIABLE LIBCPP_VERSION_COMPILE_OUTPUT
7579
)
7680
if(NOT LIBCPP_VERSION_OUTPUT)
7781
set(LIBCPP_VERSION_OUTPUT "Unknown")

0 commit comments

Comments
 (0)