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

Method AddPositionIndependentFlags

Source/cmLocalGenerator.cxx:2485–2505  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2483}
2484
2485void cmLocalGenerator::AddPositionIndependentFlags(std::string& flags,
2486 std::string const& lang,
2487 int targetType)
2488{
2489 std::string picFlags;
2490
2491 if (targetType == cmStateEnums::EXECUTABLE) {
2492 picFlags = this->Makefile->GetSafeDefinition(
2493 cmStrCat("CMAKE_", lang, "_COMPILE_OPTIONS_PIE"));
2494 }
2495 if (picFlags.empty()) {
2496 picFlags = this->Makefile->GetSafeDefinition(
2497 cmStrCat("CMAKE_", lang, "_COMPILE_OPTIONS_PIC"));
2498 }
2499 if (!picFlags.empty()) {
2500 cmList options{ picFlags };
2501 for (std::string const& o : options) {
2502 this->AppendFlagEscape(flags, o);
2503 }
2504 }
2505}
2506
2507void cmLocalGenerator::AddColorDiagnosticsFlags(std::string& flags,
2508 std::string const& lang)

Callers 1

AddFeatureFlagsMethod · 0.95

Calls 3

AppendFlagEscapeMethod · 0.95
cmStrCatFunction · 0.70
emptyMethod · 0.45

Tested by

no test coverage detected