mirror of
https://github.com/reactos/CMake.git
synced 2024-11-28 22:10:32 +00:00
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.
This commit is contained in:
parent
85ae0ba796
commit
e04f1d1b47
@ -124,6 +124,7 @@ Variables that Change Behavior
|
||||
/variable/CMAKE_AUTOMOC_RELAXED_MODE
|
||||
/variable/CMAKE_BACKWARDS_COMPATIBILITY
|
||||
/variable/CMAKE_BUILD_TYPE
|
||||
/variable/CMAKE_CODEBLOCKS_COMPILER_ID
|
||||
/variable/CMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES
|
||||
/variable/CMAKE_CODELITE_USE_TARGETS
|
||||
/variable/CMAKE_COLOR_MAKEFILE
|
||||
|
6
Help/release/dev/CodeBlocks-custom-compiler-id.rst
Normal file
6
Help/release/dev/CodeBlocks-custom-compiler-id.rst
Normal file
@ -0,0 +1,6 @@
|
||||
CodeBlocks-custom-compiler-id
|
||||
-----------------------------
|
||||
|
||||
* The :generator:`CodeBlocks` extra generator learned to check a
|
||||
:variable:`CMAKE_CODEBLOCKS_COMPILER_ID` variable for a custom
|
||||
compiler identification value to place in the project file.
|
13
Help/variable/CMAKE_CODEBLOCKS_COMPILER_ID.rst
Normal file
13
Help/variable/CMAKE_CODEBLOCKS_COMPILER_ID.rst
Normal file
@ -0,0 +1,13 @@
|
||||
CMAKE_CODEBLOCKS_COMPILER_ID
|
||||
----------------------------
|
||||
|
||||
Change the compiler id in the generated CodeBlocks project files.
|
||||
|
||||
CodeBlocks uses its own compiler id string which differs from
|
||||
:variable:`CMAKE_<LANG>_COMPILER_ID`. If this variable is left empty,
|
||||
CMake tries to recognize the CodeBlocks compiler id automatically.
|
||||
Otherwise the specified string is used in the CodeBlocks project file.
|
||||
See the CodeBlocks documentation for valid compiler id strings.
|
||||
|
||||
Other IDEs like QtCreator that also use the CodeBlocks generator may ignore
|
||||
this setting.
|
@ -28,3 +28,6 @@ endif()
|
||||
|
||||
# This variable is used by the CodeBlocks generator and appended to the make invocation commands.
|
||||
set(CMAKE_CODEBLOCKS_MAKE_ARGUMENTS "${_CMAKE_CODEBLOCKS_INITIAL_MAKE_ARGS}" CACHE STRING "Additional command line arguments when CodeBlocks invokes make. Enter e.g. -j<some_number> to get parallel builds")
|
||||
|
||||
# This variable is used by the CodeBlocks generator and allows the user to overwrite the autodetected CodeBlocks compiler id
|
||||
set(CMAKE_CODEBLOCKS_COMPILER_ID "" CACHE STRING "Id string of the compiler for the CodeBlocks IDE. Automatically detected when left empty")
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user