diff options
author | Brad King <brad.king@kitware.com> | 2018-01-18 14:40:52 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-01-18 14:41:01 (GMT) |
commit | bffdc2e2e1697ffc0ad1fa1f16e9f1092e6a6489 (patch) | |
tree | e2aed7331a0c196865fa8c13270c15053edb5a6d /Source/cmVisualStudio10TargetGenerator.cxx | |
parent | 2868019b2f93f2eb50de901d8a58ceb9b5790ae5 (diff) | |
parent | 46abfedb8395f7e72281bd8eb7bd4f118c311140 (diff) | |
download | CMake-bffdc2e2e1697ffc0ad1fa1f16e9f1092e6a6489.zip CMake-bffdc2e2e1697ffc0ad1fa1f16e9f1092e6a6489.tar.gz CMake-bffdc2e2e1697ffc0ad1fa1f16e9f1092e6a6489.tar.bz2 |
Merge topic 'msvc_cuda_8_explicitly_specify_cuda_language'
46abfedb CUDA: MSVC will now state files are cuda files when needed
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1658
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 6d81f95..1b09600 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -2667,6 +2667,7 @@ bool cmVisualStudio10TargetGenerator::ComputeCudaOptions( cudaOptions.AddFlag("GPUDebugInfo", "false"); } + bool notPtx = true; if (this->GeneratorTarget->GetPropertyAsBool("CUDA_SEPARABLE_COMPILATION")) { cudaOptions.AddFlag("GenerateRelocatableDeviceCode", "true"); } else if (this->GeneratorTarget->GetPropertyAsBool( @@ -2675,6 +2676,16 @@ bool cmVisualStudio10TargetGenerator::ComputeCudaOptions( // We drop the %(Extension) component as CMake expects all PTX files // to not have the source file extension at all cudaOptions.AddFlag("CompileOut", "$(IntDir)%(Filename).ptx"); + notPtx = false; + } + + if (notPtx && + cmSystemTools::VersionCompareGreaterEq( + "8.0", this->GlobalGenerator->GetPlatformToolsetCudaString())) { + // Explicitly state that we want this file to be treated as a + // CUDA file no matter what the file extensions is + // This is only needed for < CUDA 9 + cudaOptions.AppendFlagString("AdditionalOptions", "-x cu"); } // CUDA automatically passes the proper '--machine' flag to nvcc |