| 871 | } |
| 872 | |
| 873 | char const* cmGeneratorTarget::GetCustomObjectExtension() const |
| 874 | { |
| 875 | struct compiler_mode |
| 876 | { |
| 877 | std::string variable; |
| 878 | std::string extension; |
| 879 | }; |
| 880 | static std::array<compiler_mode, 4> const modes{ |
| 881 | { { "CUDA_PTX_COMPILATION", ".ptx" }, |
| 882 | { "CUDA_CUBIN_COMPILATION", ".cubin" }, |
| 883 | { "CUDA_FATBIN_COMPILATION", ".fatbin" }, |
| 884 | { "CUDA_OPTIX_COMPILATION", ".optixir" } } |
| 885 | }; |
| 886 | |
| 887 | std::string const& compiler = |
| 888 | this->Makefile->GetSafeDefinition("CMAKE_CUDA_COMPILER_ID"); |
| 889 | if (!compiler.empty()) { |
| 890 | for (auto const& m : modes) { |
| 891 | bool const has_extension = this->GetPropertyAsBool(m.variable); |
| 892 | if (has_extension) { |
| 893 | return m.extension.c_str(); |
| 894 | } |
| 895 | } |
| 896 | } |
| 897 | return nullptr; |
| 898 | } |
| 899 | |
| 900 | void cmGeneratorTarget::AddExplicitObjectName(cmSourceFile const* sf) |
| 901 | { |
no test coverage detected