mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
Merge topic 'cuda_host_env'
70f5d9eb49CUDA: Fix CMAKE_CUDA_COMPILER_ARG1 cache descriptionad6cd1074bHelp: Correct CUDAHOSTCXX and CUDAARCHS as having higher precedence Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6872
This commit is contained in:
@@ -6,8 +6,7 @@ CUDAARCHS
|
||||
.. include:: ENV_VAR.txt
|
||||
|
||||
Value used to initialize :variable:`CMAKE_CUDA_ARCHITECTURES` on the first
|
||||
configuration if it's not already defined. Subsequent runs will use the value
|
||||
stored in the cache.
|
||||
configuration. Subsequent runs will use the value stored in the cache.
|
||||
|
||||
This is a semicolon-separated list of architectures as described in
|
||||
:prop_tgt:`CUDA_ARCHITECTURES`.
|
||||
|
||||
@@ -8,9 +8,8 @@ CUDAHOSTCXX
|
||||
Preferred executable for compiling host code when compiling ``CUDA``
|
||||
language files. Will only be used by CMake on the first configuration to
|
||||
determine ``CUDA`` host compiler, after which the value for ``CUDAHOSTCXX`` is
|
||||
stored in the cache as :variable:`CMAKE_CUDA_HOST_COMPILER`. For any
|
||||
configuration run (including the first), the environment variable will be
|
||||
ignored if the :variable:`CMAKE_CUDA_HOST_COMPILER` variable is defined.
|
||||
stored in the cache as :variable:`CMAKE_CUDA_HOST_COMPILER`. This environment
|
||||
variable is preferred over :variable:`CMAKE_CUDA_HOST_COMPILER`.
|
||||
|
||||
This environment variable is primarily meant for use with projects that
|
||||
enable ``CUDA`` as a first-class language.
|
||||
|
||||
@@ -18,16 +18,16 @@ else()
|
||||
if(NOT CMAKE_CUDA_COMPILER)
|
||||
set(CMAKE_CUDA_COMPILER_INIT NOTFOUND)
|
||||
|
||||
# prefer the environment variable CUDACXX
|
||||
if(NOT $ENV{CUDACXX} STREQUAL "")
|
||||
get_filename_component(CMAKE_CUDA_COMPILER_INIT $ENV{CUDACXX} PROGRAM PROGRAM_ARGS CMAKE_CUDA_FLAGS_ENV_INIT)
|
||||
if(CMAKE_CUDA_FLAGS_ENV_INIT)
|
||||
set(CMAKE_CUDA_COMPILER_ARG1 "${CMAKE_CUDA_FLAGS_ENV_INIT}" CACHE STRING "Arguments to CXX compiler")
|
||||
endif()
|
||||
if(NOT EXISTS ${CMAKE_CUDA_COMPILER_INIT})
|
||||
message(FATAL_ERROR "Could not find compiler set in environment variable CUDACXX:\n$ENV{CUDACXX}.\n${CMAKE_CUDA_COMPILER_INIT}")
|
||||
endif()
|
||||
# prefer the environment variable CUDACXX
|
||||
if(NOT $ENV{CUDACXX} STREQUAL "")
|
||||
get_filename_component(CMAKE_CUDA_COMPILER_INIT $ENV{CUDACXX} PROGRAM PROGRAM_ARGS CMAKE_CUDA_FLAGS_ENV_INIT)
|
||||
if(CMAKE_CUDA_FLAGS_ENV_INIT)
|
||||
set(CMAKE_CUDA_COMPILER_ARG1 "${CMAKE_CUDA_FLAGS_ENV_INIT}" CACHE STRING "Arguments to CUDA compiler")
|
||||
endif()
|
||||
if(NOT EXISTS ${CMAKE_CUDA_COMPILER_INIT})
|
||||
message(FATAL_ERROR "Could not find compiler set in environment variable CUDACXX:\n$ENV{CUDACXX}.\n${CMAKE_CUDA_COMPILER_INIT}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# finally list compilers to try
|
||||
if(NOT CMAKE_CUDA_COMPILER_INIT)
|
||||
|
||||
Reference in New Issue
Block a user