summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-06-05 15:00:52 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-06-05 15:01:15 (GMT)
commit01069f9a107eba9765541640c65c72cc3bc27620 (patch)
treef10aa3e1bfd9e49de8ecc120c3d1a2741c6867e9
parent7934352e44db7a7afeb4fdd07939ec8394a91a6b (diff)
parent5bf9a290e74d14de7f0dc56bf31e273d7a02e282 (diff)
downloadCMake-01069f9a107eba9765541640c65c72cc3bc27620.zip
CMake-01069f9a107eba9765541640c65c72cc3bc27620.tar.gz
CMake-01069f9a107eba9765541640c65c72cc3bc27620.tar.bz2
Merge topic 'cuda-arch-cmp0104' into release-3.18
5bf9a290e7 CUDA: Fix CUDA_ARCHITECTURES policy CMP0104 check in try_compile Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4857
-rw-r--r--Source/cmCoreTryCompile.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index cc2cd01..a7acadc 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -567,6 +567,14 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
*msvcRuntimeLibraryDefault ? "NEW" : "OLD");
}
+ /* Set CUDA architectures policy to match outer project. */
+ if (this->Makefile->GetPolicyStatus(cmPolicies::CMP0104) !=
+ cmPolicies::NEW &&
+ testLangs.find("CUDA") != testLangs.end() &&
+ this->Makefile->GetSafeDefinition(kCMAKE_CUDA_ARCHITECTURES).empty()) {
+ fprintf(fout, "cmake_policy(SET CMP0104 OLD)\n");
+ }
+
std::string projectLangs;
for (std::string const& li : testLangs) {
projectLangs += " " + li;