diff options
author | Brad King <brad.king@kitware.com> | 2021-07-29 12:45:27 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-07-29 12:45:40 (GMT) |
commit | 6064c70469740de5075b077dd04c5f95b29cd948 (patch) | |
tree | f7ecac15a820a0ed346710c1e3223b3d7b0e5d68 /Source/cmNinjaNormalTargetGenerator.cxx | |
parent | 0c028df0b47441dde56a75b22a11941191d1d7c0 (diff) | |
parent | 3975678fcc3928f2a7dcd79fe9b9e9ebf3abe2b2 (diff) | |
download | CMake-6064c70469740de5075b077dd04c5f95b29cd948.zip CMake-6064c70469740de5075b077dd04c5f95b29cd948.tar.gz CMake-6064c70469740de5075b077dd04c5f95b29cd948.tar.bz2 |
Merge topic 'cuda_separable_clang_make'
3975678fcc CUDA/Clang: Simplify --register-link-binaries logic
0b1cea66cd CUDA/Clang: Fix separable compilation in non-root directories with Makefiles
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6400
Diffstat (limited to 'Source/cmNinjaNormalTargetGenerator.cxx')
-rw-r--r-- | Source/cmNinjaNormalTargetGenerator.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 93a54c2..96e9142 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -759,10 +759,6 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatements( const std::string cubin = cmStrCat(ninjaOutputDir, "/sm_", architecture, ".cubin"); - fatbinary.Variables["PROFILES"] += - cmStrCat(" -im=profile=sm_", architecture, ",file=", cubin); - fatbinary.ExplicitDeps.emplace_back(cubin); - cmNinjaBuild dlink(this->LanguageLinkerCudaDeviceRule(config)); dlink.ExplicitDeps = explicitDeps; dlink.Outputs = { cubin }; @@ -772,11 +768,15 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatements( // the device routines. Because the routines are the same for all // architectures the register file will be the same too. Thus generate it // only on the first invocation to reduce overhead. - if (fatbinary.ExplicitDeps.size() == 1) { + if (fatbinary.ExplicitDeps.empty()) { dlink.Variables["REGISTER"] = cmStrCat( "--register-link-binaries=", ninjaOutputDir, "/cmake_cuda_register.h"); } + fatbinary.Variables["PROFILES"] += + cmStrCat(" -im=profile=sm_", architecture, ",file=", cubin); + fatbinary.ExplicitDeps.emplace_back(cubin); + this->GetGlobalGenerator()->WriteBuild(this->GetCommonFileStream(), dlink); } |