MCPcopy Create free account
hub / github.com/Kitware/CMake / GetCustomObjectExtension

Method GetCustomObjectExtension

Source/cmGeneratorTarget.cxx:873–898  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

871}
872
873char 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
900void cmGeneratorTarget::AddExplicitObjectName(cmSourceFile const* sf)
901{

Callers 4

GenerateObjectsMethod · 0.80

Calls 3

GetPropertyAsBoolMethod · 0.95
c_strMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected