mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-07 22:59:56 -05:00
cmake-gui: Do not pass CMAKE_{C,CXX}_COMPILER items to cmake if empty
If C or C++ compiler is not specified in the initial dialog, do not pass `CMAKE_C_COMPILER` or `CMAKE_CXX_COMPILER` cache entries for cross-compilation setup. Instead allow the normal search for the compiler to proceed.
This commit is contained in:
@@ -808,11 +808,15 @@ bool CMakeSetupDialog::setupFirstConfigure()
|
|||||||
m->insertProperty(QCMakeProperty::STRING, "CMAKE_SYSTEM_PROCESSOR",
|
m->insertProperty(QCMakeProperty::STRING, "CMAKE_SYSTEM_PROCESSOR",
|
||||||
tr("CMake System Processor"), systemProcessor, false);
|
tr("CMake System Processor"), systemProcessor, false);
|
||||||
QString cxxCompiler = dialog.getCXXCompiler();
|
QString cxxCompiler = dialog.getCXXCompiler();
|
||||||
|
if (!cxxCompiler.isEmpty()) {
|
||||||
m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_CXX_COMPILER",
|
m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_CXX_COMPILER",
|
||||||
tr("CXX compiler."), cxxCompiler, false);
|
tr("CXX compiler."), cxxCompiler, false);
|
||||||
|
}
|
||||||
QString cCompiler = dialog.getCCompiler();
|
QString cCompiler = dialog.getCCompiler();
|
||||||
|
if (!cCompiler.isEmpty()) {
|
||||||
m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_C_COMPILER",
|
m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_C_COMPILER",
|
||||||
tr("C compiler."), cCompiler, false);
|
tr("C compiler."), cCompiler, false);
|
||||||
|
}
|
||||||
} else if (dialog.crossCompilerToolChainFile()) {
|
} else if (dialog.crossCompilerToolChainFile()) {
|
||||||
QString toolchainFile = dialog.getCrossCompilerToolChainFile();
|
QString toolchainFile = dialog.getCrossCompilerToolChainFile();
|
||||||
m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_TOOLCHAIN_FILE",
|
m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_TOOLCHAIN_FILE",
|
||||||
|
|||||||
Reference in New Issue
Block a user