diff options
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CMakeDetermineCUDACompiler.cmake | 10 | ||||
-rw-r--r-- | Modules/Compiler/AppleClang-C.cmake | 2 | ||||
-rw-r--r-- | Modules/Compiler/AppleClang-CXX.cmake | 2 | ||||
-rw-r--r-- | Modules/Compiler/Clang-C.cmake | 2 | ||||
-rw-r--r-- | Modules/Compiler/Clang-CXX.cmake | 2 | ||||
-rw-r--r-- | Modules/Compiler/GNU-C.cmake | 2 | ||||
-rw-r--r-- | Modules/Compiler/GNU-CXX.cmake | 2 | ||||
-rw-r--r-- | Modules/Compiler/Intel-C.cmake | 2 | ||||
-rw-r--r-- | Modules/Compiler/Intel-CXX.cmake | 2 | ||||
-rw-r--r-- | Modules/Compiler/XL-C.cmake | 2 | ||||
-rw-r--r-- | Modules/Compiler/XL-CXX.cmake | 5 | ||||
-rw-r--r-- | Modules/Compiler/XLClang-C.cmake | 2 | ||||
-rw-r--r-- | Modules/Compiler/XLClang-CXX.cmake | 2 | ||||
-rw-r--r-- | Modules/FindGTest.cmake | 40 |
14 files changed, 21 insertions, 56 deletions
diff --git a/Modules/CMakeDetermineCUDACompiler.cmake b/Modules/CMakeDetermineCUDACompiler.cmake index 9220551f3..972adefd1 100644 --- a/Modules/CMakeDetermineCUDACompiler.cmake +++ b/Modules/CMakeDetermineCUDACompiler.cmake @@ -176,13 +176,15 @@ if(NOT CMAKE_CUDA_COMPILER_ID_RUN) # In a non-scattered installation the following are equivalent to CMAKE_CUDA_COMPILER_TOOLKIT_ROOT. # We first check for a non-scattered installation to prefer it over a scattered installation. - # CMAKE_CUDA_COMPILER_LIBRARY_ROOT contains the device library and version file. - if(EXISTS "${CMAKE_CUDA_COMPILER_TOOLKIT_ROOT}/version.txt") + # CMAKE_CUDA_COMPILER_LIBRARY_ROOT contains the device library. + if(EXISTS "${CMAKE_CUDA_COMPILER_TOOLKIT_ROOT}/nvvm/libdevice") set(CMAKE_CUDA_COMPILER_LIBRARY_ROOT "${CMAKE_CUDA_COMPILER_TOOLKIT_ROOT}") - elseif(CMAKE_SYSROOT_LINK AND EXISTS "${CMAKE_SYSROOT_LINK}/usr/lib/cuda/version.txt") + elseif(CMAKE_SYSROOT_LINK AND EXISTS "${CMAKE_SYSROOT_LINK}/usr/lib/cuda/nvvm/libdevice") set(CMAKE_CUDA_COMPILER_LIBRARY_ROOT "${CMAKE_SYSROOT_LINK}/usr/lib/cuda") - elseif(EXISTS "${CMAKE_SYSROOT}/usr/lib/cuda/version.txt") + elseif(EXISTS "${CMAKE_SYSROOT}/usr/lib/cuda/nvvm/libdevice") set(CMAKE_CUDA_COMPILER_LIBRARY_ROOT "${CMAKE_SYSROOT}/usr/lib/cuda") + else() + message(FATAL_ERROR "Couldn't find CUDA library root.") endif() # CMAKE_CUDA_COMPILER_TOOLKIT_LIBRARY_ROOT contains the linking stubs necessary for device linking and other low-level library files. diff --git a/Modules/Compiler/AppleClang-C.cmake b/Modules/Compiler/AppleClang-C.cmake index 26a4bbd33..2794f52bb 100644 --- a/Modules/Compiler/AppleClang-C.cmake +++ b/Modules/Compiler/AppleClang-C.cmake @@ -1,8 +1,6 @@ include(Compiler/Clang) __compiler_clang(C) -set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c) - if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.0) set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c90") set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu90") diff --git a/Modules/Compiler/AppleClang-CXX.cmake b/Modules/Compiler/AppleClang-CXX.cmake index 611c67457..15edc21e9 100644 --- a/Modules/Compiler/AppleClang-CXX.cmake +++ b/Modules/Compiler/AppleClang-CXX.cmake @@ -1,8 +1,6 @@ include(Compiler/Clang) __compiler_clang(CXX) -set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c++) - if(NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC") set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden") endif() diff --git a/Modules/Compiler/Clang-C.cmake b/Modules/Compiler/Clang-C.cmake index fb6ffa7b0..7c4a263f6 100644 --- a/Modules/Compiler/Clang-C.cmake +++ b/Modules/Compiler/Clang-C.cmake @@ -8,8 +8,6 @@ endif() if("x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC") set(CMAKE_C_CLANG_TIDY_DRIVER_MODE "cl") -elseif("x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU") - set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c) endif() if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.4) diff --git a/Modules/Compiler/Clang-CXX.cmake b/Modules/Compiler/Clang-CXX.cmake index 311d2b07f..789e99159 100644 --- a/Modules/Compiler/Clang-CXX.cmake +++ b/Modules/Compiler/Clang-CXX.cmake @@ -2,9 +2,7 @@ include(Compiler/Clang) __compiler_clang(CXX) __compiler_clang_cxx_standards(CXX) - if("x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU") - set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c++) set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden") endif() diff --git a/Modules/Compiler/GNU-C.cmake b/Modules/Compiler/GNU-C.cmake index 8105a77f6..ca286b397 100644 --- a/Modules/Compiler/GNU-C.cmake +++ b/Modules/Compiler/GNU-C.cmake @@ -1,8 +1,6 @@ include(Compiler/GNU) __compiler_gnu(C) -set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c) - if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5) set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c90") set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu90") diff --git a/Modules/Compiler/GNU-CXX.cmake b/Modules/Compiler/GNU-CXX.cmake index 59ec05691..fcaaeab43 100644 --- a/Modules/Compiler/GNU-CXX.cmake +++ b/Modules/Compiler/GNU-CXX.cmake @@ -1,8 +1,6 @@ include(Compiler/GNU) __compiler_gnu(CXX) -set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c++) - if (WIN32) if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6) set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fno-keep-inline-dllexport") diff --git a/Modules/Compiler/Intel-C.cmake b/Modules/Compiler/Intel-C.cmake index 322f63d0d..ec3bfd88f 100644 --- a/Modules/Compiler/Intel-C.cmake +++ b/Modules/Compiler/Intel-C.cmake @@ -28,8 +28,6 @@ if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC") else() - set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c) - if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 15.0.0) set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c11") set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu11") diff --git a/Modules/Compiler/Intel-CXX.cmake b/Modules/Compiler/Intel-CXX.cmake index 42adfd10c..b71b946e9 100644 --- a/Modules/Compiler/Intel-CXX.cmake +++ b/Modules/Compiler/Intel-CXX.cmake @@ -42,8 +42,6 @@ if("x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC") else() - set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c++) - if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0.0) set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "-std=c++20") set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION "-std=gnu++20") diff --git a/Modules/Compiler/XL-C.cmake b/Modules/Compiler/XL-C.cmake index 78c44d5d7..2077bdabd 100644 --- a/Modules/Compiler/XL-C.cmake +++ b/Modules/Compiler/XL-C.cmake @@ -6,8 +6,6 @@ string(APPEND CMAKE_C_FLAGS_MINSIZEREL_INIT " -DNDEBUG") # -qthreaded = Ensures that all optimizations will be thread-safe string(APPEND CMAKE_C_FLAGS_INIT " -qthreaded") -set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -qsourcetype=c) - if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 10.1) set(CMAKE_C90_STANDARD_COMPILE_OPTION "-qlanglvl=stdc89") set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-qlanglvl=extc89") diff --git a/Modules/Compiler/XL-CXX.cmake b/Modules/Compiler/XL-CXX.cmake index 3b911f3d6..41e3e1119 100644 --- a/Modules/Compiler/XL-CXX.cmake +++ b/Modules/Compiler/XL-CXX.cmake @@ -6,8 +6,6 @@ string(APPEND CMAKE_CXX_FLAGS_MINSIZEREL_INIT " -DNDEBUG") # -qthreaded = Ensures that all optimizations will be thread-safe string(APPEND CMAKE_CXX_FLAGS_INIT " -qthreaded") -set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -+) - if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10.1) if(CMAKE_SYSTEM MATCHES "Linux") set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "") @@ -34,3 +32,6 @@ if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10.1) endif () __compiler_check_default_language_standard(CXX 10.1 98) + +set(CMAKE_CXX_COMPILE_OBJECT + "<CMAKE_CXX_COMPILER> -+ <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>") diff --git a/Modules/Compiler/XLClang-C.cmake b/Modules/Compiler/XLClang-C.cmake index 1668a4d0f..54c18a668 100644 --- a/Modules/Compiler/XLClang-C.cmake +++ b/Modules/Compiler/XLClang-C.cmake @@ -1,8 +1,6 @@ include(Compiler/XLClang) __compiler_xlclang(C) -set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c) - if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 13.1.1) set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c89") set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu89") diff --git a/Modules/Compiler/XLClang-CXX.cmake b/Modules/Compiler/XLClang-CXX.cmake index 02638c791..9ea3d7cac 100644 --- a/Modules/Compiler/XLClang-CXX.cmake +++ b/Modules/Compiler/XLClang-CXX.cmake @@ -1,8 +1,6 @@ include(Compiler/XLClang) __compiler_xlclang(CXX) -set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c++) - if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13.1.1) set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "") set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "") diff --git a/Modules/FindGTest.cmake b/Modules/FindGTest.cmake index 10e31b29f..53cab1a76 100644 --- a/Modules/FindGTest.cmake +++ b/Modules/FindGTest.cmake @@ -96,27 +96,6 @@ function(__gtest_find_library _name) mark_as_advanced(${_name}) endfunction() -function(__gtest_find_library_configuration _name _lib _cfg_suffix) - set(_libs ${_lib}) - if(MSVC AND GTEST_MSVC_SEARCH STREQUAL "MD") - # The provided /MD project files for Google Test add -md suffixes to the - # library names. - list(INSERT _libs 0 ${_lib}-md) - endif() - list(TRANSFORM _libs APPEND "${_cfg_suffix}") - - __gtest_find_library(${_name} ${_libs}) -endfunction() - -include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake) -function(__gtest_find_and_select_library_configurations _basename _lib) - __gtest_find_library_configuration(${_basename}_LIBRARY_RELEASE ${_lib} "") - __gtest_find_library_configuration(${_basename}_LIBRARY_DEBUG ${_lib} "d") - - select_library_configurations(${_basename}) - set(${_basename}_LIBRARY ${${_basename}_LIBRARY} PARENT_SCOPE) -endfunction() - macro(__gtest_determine_windows_library_type _var) if(EXISTS "${${_var}}") file(TO_NATIVE_PATH "${${_var}}" _lib_path) @@ -208,13 +187,18 @@ find_path(GTEST_INCLUDE_DIR gtest/gtest.h ) mark_as_advanced(GTEST_INCLUDE_DIR) -# Allow GTEST_LIBRARY and GTEST_MAIN_LIBRARY to be set manually, as the -# locations of the gtest and gtest_main libraries, respectively. -if(NOT GTEST_LIBRARY) - __gtest_find_and_select_library_configurations(GTEST gtest) -endif() -if(NOT GTEST_MAIN_LIBRARY) - __gtest_find_and_select_library_configurations(GTEST_MAIN gtest_main) +if(MSVC AND GTEST_MSVC_SEARCH STREQUAL "MD") + # The provided /MD project files for Google Test add -md suffixes to the + # library names. + __gtest_find_library(GTEST_LIBRARY gtest-md gtest) + __gtest_find_library(GTEST_LIBRARY_DEBUG gtest-mdd gtestd) + __gtest_find_library(GTEST_MAIN_LIBRARY gtest_main-md gtest_main) + __gtest_find_library(GTEST_MAIN_LIBRARY_DEBUG gtest_main-mdd gtest_maind) +else() + __gtest_find_library(GTEST_LIBRARY gtest) + __gtest_find_library(GTEST_LIBRARY_DEBUG gtestd) + __gtest_find_library(GTEST_MAIN_LIBRARY gtest_main) + __gtest_find_library(GTEST_MAIN_LIBRARY_DEBUG gtest_maind) endif() include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) |