From 587cf3f27bb76e270022c7f7835005d1e73135ee Mon Sep 17 00:00:00 2001 From: David Chisnall Date: Tue, 26 Dec 2017 19:08:05 +0000 Subject: [PATCH] Another try at making CMake work. --- CMakeLists.txt | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5391b50..3031462 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -165,17 +165,16 @@ set_source_files_properties( function(test_cxx CXX_RUNTIME_NAME IS_STDLIB) set(CXX_RUNTIME_NAME "${CMAKE_SHARED_LIBRARY_PREFIX}${CXX_RUNTIME_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}") - message(STATUS "Testing ${CXX_RUNTIME_NAME} as the C++ runtime library") - find_library(CXX_RUNTIME NAMES ${CXX_RUNTIME_NAME}) - if (CXX_RUNTIME) - message(STATUS "Testing ${CXX_RUNTIME} as the C++ runtime library") + find_library(CXX_RUNTIME_LIB NAMES ${CXX_RUNTIME_NAME}) + if (CXX_RUNTIME_LIB) + message(STATUS "Testing ${CXX_RUNTIME_LIB} as the C++ runtime library") try_compile(USERUNTIME "${CMAKE_BINARY_DIR}/CMake" "${CMAKE_SOURCE_DIR}/CMake" test_cxx_runtime - CMAKE_FLAGS "-DCXX_RUNTIME=${CXX_RUNTIME} -DTEST_LINKER_LANGUAGE=C") - if (${USERUNTIME}) - set(CXX_RUNTIME ${CXX_RUNTIME} PARENT_SCOPE) + CMAKE_FLAGS "-DCXX_RUNTIME=${CXX_RUNTIME_LIB}") + if (USERUNTIME) + set(CXX_RUNTIME ${CXX_RUNTIME_LIB} PARENT_SCOPE) endif() endif() endfunction()