diff options
Diffstat (limited to 'Source/cmCoreTryCompile.cxx')
-rw-r--r-- | Source/cmCoreTryCompile.cxx | 8 |
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; |