summaryrefslogtreecommitdiff
path: root/Source/cmExtraCodeBlocksGenerator.cxx
diff options
context:
space:
mode:
authorMelven Roehrig-Zoellner <Melven.Roehrig-Zoellner@DLR.de>2017-11-20 21:06:29 +0100
committerBrad King <brad.king@kitware.com>2017-11-27 14:41:54 -0500
commite04f1d1b47f395cd702574041aa17e52e71499d8 (patch)
treef545f6160ca637341a272d8ddf5de8661f6ea75d /Source/cmExtraCodeBlocksGenerator.cxx
parent85ae0ba796c26b9ba2f7025e267d3f438db388c6 (diff)
downloadcmake-e04f1d1b47f395cd702574041aa17e52e71499d8.tar.gz
CodeBlocks: add option for the CB compiler ID
CodeBlocks uses his own compiler ID string which may differ from CMAKE_<LANG>_COMPILER_ID. In particular CodeBlocks supports a large number of different compiler configurations (with different IDs) This commit adds a cache variable "CMAKE_CODEBLOCKS_COMPILER_ID", so the user might adjust it when needed.
Diffstat (limited to 'Source/cmExtraCodeBlocksGenerator.cxx')
-rw-r--r--Source/cmExtraCodeBlocksGenerator.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx
index 9c9b75b17b..dd5bcf19b9 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -648,6 +648,13 @@ void cmExtraCodeBlocksGenerator::AppendTarget(
// Translate the cmake compiler id into the CodeBlocks compiler id
std::string cmExtraCodeBlocksGenerator::GetCBCompilerId(const cmMakefile* mf)
{
+ // allow the user to overwrite the detected compiler
+ std::string userCompiler =
+ mf->GetSafeDefinition("CMAKE_CODEBLOCKS_COMPILER_ID");
+ if (!userCompiler.empty()) {
+ return userCompiler;
+ }
+
// figure out which language to use
// for now care only for C, C++, and Fortran