From 1086e930dc8ad94847f17f627673db8f7a3fb3ab Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Mon, 18 May 2020 10:54:11 -0400 Subject: CUDA: Propagate CMAKE_CUDA_RUNTIME_LIBRARY state to try_compile --- Help/command/try_compile.rst | 1 + Source/cmCoreTryCompile.cxx | 3 +++ 2 files changed, 4 insertions(+) diff --git a/Help/command/try_compile.rst b/Help/command/try_compile.rst index edbf92c..323077a 100644 --- a/Help/command/try_compile.rst +++ b/Help/command/try_compile.rst @@ -135,6 +135,7 @@ If set, the following variables are passed in to the generated try_compile CMakeLists.txt to initialize compile target properties with default values: +* :variable:`CMAKE_CUDA_RUNTIME_LIBRARY` * :variable:`CMAKE_ENABLE_EXPORTS` * :variable:`CMAKE_LINK_SEARCH_START_STATIC` * :variable:`CMAKE_LINK_SEARCH_END_STATIC` diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index da04396..73f099b 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -40,6 +40,8 @@ static std::string const kCMAKE_CXX_LINK_NO_PIE_SUPPORTED = "CMAKE_CXX_LINK_NO_PIE_SUPPORTED"; static std::string const kCMAKE_CXX_LINK_PIE_SUPPORTED = "CMAKE_CXX_LINK_PIE_SUPPORTED"; +static std::string const kCMAKE_CUDA_RUNTIME_LIBRARY = + "CMAKE_CUDA_RUNTIME_LIBRARY"; static std::string const kCMAKE_ENABLE_EXPORTS = "CMAKE_ENABLE_EXPORTS"; static std::string const kCMAKE_LINK_SEARCH_END_STATIC = "CMAKE_LINK_SEARCH_END_STATIC"; @@ -719,6 +721,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv, vars.insert(kCMAKE_C_COMPILER_TARGET); vars.insert(kCMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN); vars.insert(kCMAKE_CXX_COMPILER_TARGET); + vars.insert(kCMAKE_CUDA_RUNTIME_LIBRARY); vars.insert(kCMAKE_ENABLE_EXPORTS); vars.insert(kCMAKE_LINK_SEARCH_END_STATIC); vars.insert(kCMAKE_LINK_SEARCH_START_STATIC); -- cgit v0.12