diff options
-rw-r--r-- | Help/guide/tutorial/Step1/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Help/variable/CMAKE_ANDROID_API.rst | 7 | ||||
-rw-r--r-- | Modules/CMakeTestCUDACompiler.cmake | 6 | ||||
-rw-r--r-- | Modules/FindJNI.cmake | 4 | ||||
-rw-r--r-- | Modules/Platform/SerenityOS.cmake | 2 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 9 | ||||
-rw-r--r-- | Tests/CudaOnly/CMakeLists.txt | 6 | ||||
-rw-r--r-- | Tests/CudaOnly/ToolkitIsSystemInclude/CMakeLists.txt | 7 | ||||
-rw-r--r-- | Tests/CudaOnly/ToolkitIsSystemInclude/include/nvrtc.h | 5 | ||||
-rw-r--r-- | Tests/CudaOnly/ToolkitIsSystemInclude/main.cu | 4 |
10 files changed, 14 insertions, 38 deletions
diff --git a/Help/guide/tutorial/Step1/CMakeLists.txt b/Help/guide/tutorial/Step1/CMakeLists.txt index 282951ad53..6fcce90ff3 100644 --- a/Help/guide/tutorial/Step1/CMakeLists.txt +++ b/Help/guide/tutorial/Step1/CMakeLists.txt @@ -5,7 +5,7 @@ # TODO 7: Set the project version number as 1.0 in the above project command # TODO 6: Set the variable CMAKE_CXX_STANDARD to 11 -# and the variable CMAKE_CXX_REQUIRED_STANDARD to True +# and the variable CMAKE_CXX_STANDARD_REQUIRED to True # TODO 8: Use configure_file to configure and copy TutorialConfig.h.in to # TutorialConfig.h diff --git a/Help/variable/CMAKE_ANDROID_API.rst b/Help/variable/CMAKE_ANDROID_API.rst index 4388bf2e05..aba9b6eb6d 100644 --- a/Help/variable/CMAKE_ANDROID_API.rst +++ b/Help/variable/CMAKE_ANDROID_API.rst @@ -8,6 +8,7 @@ Edition`, this variable may be set to specify the default value for the :prop_tgt:`ANDROID_API` target property. See that target property for additional information. -Otherwise, when :ref:`Cross Compiling for Android`, this variable provides -the Android API version number targeted. This will be the same value as -the :variable:`CMAKE_SYSTEM_VERSION` variable for ``Android`` platforms. +When :ref:`Cross Compiling for Android`, the :variable:`CMAKE_SYSTEM_VERSION` +variable represents the Android API version number targeted. For historical +reasons, if a toolchain file sets ``CMAKE_ANDROID_API``, but not +``CMAKE_SYSTEM_VERSION``, the latter will be initialized using the former. diff --git a/Modules/CMakeTestCUDACompiler.cmake b/Modules/CMakeTestCUDACompiler.cmake index a89182b9dc..f2fa6ea908 100644 --- a/Modules/CMakeTestCUDACompiler.cmake +++ b/Modules/CMakeTestCUDACompiler.cmake @@ -127,8 +127,10 @@ list(REMOVE_ITEM CMAKE_CUDA_IMPLICIT_LINK_LIBRARIES ${CMAKE_CUDA_IMPLICIT_LINK_L if(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA") # Remove the CUDA Toolkit include directories from the set of # implicit system include directories. - # CMake will explicitly mark these as SYSTEM to NVCC since it implicitly - # adds them as user includes and not system + # This resolves the issue that NVCC doesn't specify these + # includes as SYSTEM includes when compiling device code, and sometimes + # they contain headers that generate warnings, so let users mark them + # as SYSTEM explicitly if(CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES) list(REMOVE_ITEM CMAKE_CUDA_IMPLICIT_INCLUDE_DIRECTORIES ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES} diff --git a/Modules/FindJNI.cmake b/Modules/FindJNI.cmake index e93b91e2b1..64163b008a 100644 --- a/Modules/FindJNI.cmake +++ b/Modules/FindJNI.cmake @@ -107,7 +107,7 @@ include(FindPackageHandleStandardArgs) if(NOT JNI_FIND_COMPONENTS) if(ANDROID) - if(CMAKE_ANDROID_API LESS 31) + if(CMAKE_SYSTEM_VERSION LESS 31) # There are no components for Android NDK set(JNI_FIND_COMPONENTS) else() @@ -125,7 +125,7 @@ else() # On Android, if JVM was requested we need to find NativeHelper as well which # is an implicit dependency of JVM allowing to provide uniform access to basic # JVM/DVM functionality. - if(ANDROID AND CMAKE_ANDROID_API GREATER_EQUAL 31 AND JVM IN_LIST JNI_FIND_COMPONENTS) + if(ANDROID AND CMAKE_SYSTEM_VERSION GREATER_EQUAL 31 AND JVM IN_LIST JNI_FIND_COMPONENTS) if(NOT NativeHelper IN_LIST JNI_FIND_COMPONENTS) list(APPEND JNI_FIND_COMPONENTS NativeHelper) # NativeHelper is required only if JVM was requested as such. diff --git a/Modules/Platform/SerenityOS.cmake b/Modules/Platform/SerenityOS.cmake index 541620c20b..dc4f369dc0 100644 --- a/Modules/Platform/SerenityOS.cmake +++ b/Modules/Platform/SerenityOS.cmake @@ -1,7 +1,7 @@ set(SERENITYOS 1) -set(CMAKE_DL_LIBS "-ldl") +set(CMAKE_DL_LIBS "") set(CMAKE_SHARED_LIBRARY_RPATH_ORIGIN_TOKEN "\$ORIGIN") set(CMAKE_SHARED_LIBRARY_SUFFIX ".so") diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 6962b52c7c..c2bf888d10 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1855,15 +1855,6 @@ void cmGlobalGenerator::FinalizeTargetConfiguration() cmExpandedList(standardIncludesStr); standardIncludesSet.insert(standardIncludesVec.begin(), standardIncludesVec.end()); - if (li == "CUDA") { - std::string const& cudaSystemIncludeVar = - mf->GetSafeDefinition("CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES"); - std::vector<std::string> cudaToolkitIncludeVec = - cmExpandedList(cudaSystemIncludeVar); - standardIncludesSet.insert(cudaToolkitIncludeVec.begin(), - cudaToolkitIncludeVec.end()); - mf->AddIncludeDirectories(cudaToolkitIncludeVec); - } } mf->AddSystemIncludeDirectories(standardIncludesSet); } diff --git a/Tests/CudaOnly/CMakeLists.txt b/Tests/CudaOnly/CMakeLists.txt index d23e9298a9..091872d3ce 100644 --- a/Tests/CudaOnly/CMakeLists.txt +++ b/Tests/CudaOnly/CMakeLists.txt @@ -27,12 +27,10 @@ if(CMake_TEST_CUDA AND NOT CMake_TEST_CUDA STREQUAL "Clang") add_cuda_test_macro(CudaOnly.GPUDebugFlag CudaOnlyGPUDebugFlag) endif() +# The CUDA only ships the shared version of the toolkit libraries +# on windows if(NOT WIN32) - # The CUDA only ships the shared version of the toolkit libraries - # on windows add_cuda_test_macro(CudaOnly.StaticRuntimePlusToolkit CudaOnlyStaticRuntimePlusToolkit) - # `isystem` behaves differently on windows with nvcc - add_cuda_test_macro(CudaOnly.ToolkitIsSystemInclude CudaOnlySystemInclude) endif() add_cuda_test_macro(CudaOnly.DeviceLTO CudaOnlyDeviceLTO) diff --git a/Tests/CudaOnly/ToolkitIsSystemInclude/CMakeLists.txt b/Tests/CudaOnly/ToolkitIsSystemInclude/CMakeLists.txt deleted file mode 100644 index bc347dda10..0000000000 --- a/Tests/CudaOnly/ToolkitIsSystemInclude/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.24) -project(ToolkitIsSystemInclude CUDA) - -# Verify that the nvrtc.h that is inside `CMAKE_CURRENT_SOURCE_DIR` is still -# the first include for `.cu` files. -add_executable(CudaOnlySystemInclude main.cu) -target_include_directories(CudaOnlySystemInclude SYSTEM PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include) diff --git a/Tests/CudaOnly/ToolkitIsSystemInclude/include/nvrtc.h b/Tests/CudaOnly/ToolkitIsSystemInclude/include/nvrtc.h deleted file mode 100644 index 5a015c4d76..0000000000 --- a/Tests/CudaOnly/ToolkitIsSystemInclude/include/nvrtc.h +++ /dev/null @@ -1,5 +0,0 @@ -#define CMAKE_CUDA_TOOLKIT_IS_SYSTEM 1 - -int main() -{ -} diff --git a/Tests/CudaOnly/ToolkitIsSystemInclude/main.cu b/Tests/CudaOnly/ToolkitIsSystemInclude/main.cu deleted file mode 100644 index 6cff8a1177..0000000000 --- a/Tests/CudaOnly/ToolkitIsSystemInclude/main.cu +++ /dev/null @@ -1,4 +0,0 @@ -#include "nvrtc.h" -#ifndef CMAKE_CUDA_TOOLKIT_IS_SYSTEM -# error "Failed to specify the CUDA Toolkit includes as system" -#endif |