mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-22 06:59:01 -06:00
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
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user