diff --git a/CMakeLists.txt b/CMakeLists.txt index 45e7633..32fdf33 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -205,7 +205,7 @@ function(test_cxx CXX_RUNTIME_NAME IS_STDLIB) message(STATUS "Testing ${CXX_RUNTIME_LIB} as the C++ runtime library") try_compile(USERUNTIME "${CMAKE_BINARY_DIR}/CMake" - "${CMAKE_SOURCE_DIR}/CMake" + "${CMAKE_CURRENT_LIST_DIR}/CMake" test_cxx_runtime CMAKE_FLAGS "-DCXX_RUNTIME=${CXX_RUNTIME_LIB}") if (USERUNTIME) @@ -276,7 +276,7 @@ if (ENABLE_OBJCXX) message(STATUS "Testing C++ standard library") try_compile(USERUNTIME "${CMAKE_BINARY_DIR}/CMake" - "${CMAKE_SOURCE_DIR}/CMake" + "${CMAKE_CURRENT_LIST_DIR}/CMake" test_cxx_runtime) if (${USERUNTIME}) message(STATUS "libobjc will depend on C++ standard library")