diff options
author | Brad King <brad.king@kitware.com> | 2019-02-26 16:07:46 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-02-26 16:07:54 (GMT) |
commit | 3c7662fd625079553d3edd004fcf2b3348d38415 (patch) | |
tree | f9bbfa6670f0e5fd17f146a5559887b558e9a8b0 /Source/cmGlobalGenerator.cxx | |
parent | 5ac1c809f7cc257807afc1fa779150aa1738fe4a (diff) | |
parent | d9d285c5ad2987ed4aa3ff89093818239781708f (diff) | |
download | CMake-3c7662fd625079553d3edd004fcf2b3348d38415.zip CMake-3c7662fd625079553d3edd004fcf2b3348d38415.tar.gz CMake-3c7662fd625079553d3edd004fcf2b3348d38415.tar.bz2 |
Merge topic 'add-xlclang'
d9d285c5ad jsoncpp: Fix include order for build within CMake
0d489fab19 libuv: fix atomic ops compilation with xlclang
1699f5c231 Utilities: Suppress warnings in third-party code when using XLClang
f709089d84 XLClang: Extract compiler implicit include directories
5c41386357 XLClang: Add policy CMP0089 to present as XL for compatibility
8278237933 XL: Remove overlap with the new XLClang compiler ID
6f5cf2d2c6 XL: Revert "Recognize compilers identified by __ibmxl__"
90c6156aa8 XLClang: Add a new compiler ID for the clang-based XL compiler
...
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2921
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index a22cd18..c7b3591 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -956,6 +956,36 @@ void cmGlobalGenerator::CheckCompilerIdCompatibility( break; } } + + if (strcmp(compilerId, "XLClang") == 0) { + switch (mf->GetPolicyStatus(cmPolicies::CMP0089)) { + case cmPolicies::WARN: + if (!this->CMakeInstance->GetIsInTryCompile() && + mf->PolicyOptionalWarningEnabled("CMAKE_POLICY_WARNING_CMP0089")) { + std::ostringstream w; + /* clang-format off */ + w << cmPolicies::GetPolicyWarning(cmPolicies::CMP0089) << "\n" + "Converting " << lang << + " compiler id \"XLClang\" to \"XL\" for compatibility." + ; + /* clang-format on */ + mf->IssueMessage(MessageType::AUTHOR_WARNING, w.str()); + } + CM_FALLTHROUGH; + case cmPolicies::OLD: + // OLD behavior is to convert XLClang to XL. + mf->AddDefinition(compilerIdVar, "XL"); + break; + case cmPolicies::REQUIRED_IF_USED: + case cmPolicies::REQUIRED_ALWAYS: + mf->IssueMessage( + MessageType::FATAL_ERROR, + cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0089)); + case cmPolicies::NEW: + // NEW behavior is to keep AppleClang. + break; + } + } } std::string cmGlobalGenerator::GetLanguageOutputExtension( |