summaryrefslogtreecommitdiffstats
path: root/Source/cmQtAutoGenInitializer.h
diff options
context:
space:
mode:
authorOrkun Tokdemir <ilhanorkuntokdemir@gmail.com>2023-06-14 11:10:03 (GMT)
committerOrkun Tokdemir <ilhanorkuntokdemir@gmail.com>2023-09-13 16:23:56 (GMT)
commitfddd0f0443b4ce81d61f15ee1b2f13105967b25a (patch)
tree46e0ed1f11a9ac721672977758c2a628478cba32 /Source/cmQtAutoGenInitializer.h
parent10b09647f2699b32c3d243f595437cb1c63049e2 (diff)
downloadCMake-fddd0f0443b4ce81d61f15ee1b2f13105967b25a.zip
CMake-fddd0f0443b4ce81d61f15ee1b2f13105967b25a.tar.gz
CMake-fddd0f0443b4ce81d61f15ee1b2f13105967b25a.tar.bz2
Autogen: AUTO*_EXECUTABLE: add support for per-config values
* Per-config values were added to `AUTO*_EXECUTABLE`. * Dependency order was refactored for `cmake_autogen` and `cmake_autorcc` to avoid unnecessary rebuilds. * A new parameter was added for `cmake_autogen` and `cmake_autorcc` to specify the config name of the `auto*_executable` to be used. * The timestamp target was split into three targets for per-config to avoid redundant `mocs_compilation` builds. * Per-config `DEP_FILE_RULE_NAME` values were added to `AutogenInfo.json` for `CMAKE_CROSS_CONFIG` usage. * Some functions were refactored to avoid code duplication. Fixes: #20074
Diffstat (limited to 'Source/cmQtAutoGenInitializer.h')
-rw-r--r--Source/cmQtAutoGenInitializer.h34
1 files changed, 12 insertions, 22 deletions
diff --git a/Source/cmQtAutoGenInitializer.h b/Source/cmQtAutoGenInitializer.h
index a44d33f..ee37d2f 100644
--- a/Source/cmQtAutoGenInitializer.h
+++ b/Source/cmQtAutoGenInitializer.h
@@ -18,6 +18,7 @@
#include "cmFilePathChecksum.h"
#include "cmQtAutoGen.h"
+class cmCustomCommandLines;
class cmGeneratorTarget;
class cmGlobalGenerator;
class cmLocalGenerator;
@@ -32,23 +33,6 @@ class cmTarget;
class cmQtAutoGenInitializer : public cmQtAutoGen
{
public:
- /** String value with per configuration variants. */
- class ConfigString
- {
- public:
- std::string Default;
- std::unordered_map<std::string, std::string> Config;
- };
-
- /** String values with per configuration variants. */
- template <typename C>
- class ConfigStrings
- {
- public:
- C Default;
- std::unordered_map<std::string, C> Config;
- };
-
/** rcc job. */
class Qrc
{
@@ -63,7 +47,7 @@ public:
bool Generated = false;
bool Unique = false;
std::vector<std::string> Options;
- std::vector<std::string> Resources;
+ ConfigStrings<std::vector<std::string>> Resources;
};
/** moc and/or uic file. */
@@ -90,8 +74,8 @@ public:
// Executable
std::string ExecutableTargetName;
cmGeneratorTarget* ExecutableTarget = nullptr;
- std::string Executable;
- CompilerFeaturesHandle ExecutableFeatures;
+ ConfigString Executable;
+ ConfigStrings<CompilerFeaturesHandle> ExecutableFeatures;
GenVarsT(GenT gen)
: Gen(gen)
@@ -141,6 +125,9 @@ private:
GenVarsT const& genVars, bool prepend = false);
void AddToSourceGroup(std::string const& fileName,
cm::string_view genNameUpper);
+ void AddCMakeProcessToCommandLines(std::string const& infoFile,
+ std::string const& processName,
+ cmCustomCommandLines& commandLines);
void AddCleanFile(std::string const& fileName);
void ConfigFileNames(ConfigString& configString, cm::string_view prefix,
@@ -155,6 +142,9 @@ private:
bool ignoreMissingTarget) const;
void handleSkipPch(cmSourceFile* sf);
+ void AddAutogenExecutableToDependencies(
+ cmQtAutoGenInitializer::GenVarsT const& genVars,
+ std::vector<std::string>& dependencies) const;
cmQtAutoGenGlobalInitializer* GlobalInitializer = nullptr;
cmGeneratorTarget* GenTarget = nullptr;
@@ -202,8 +192,8 @@ private:
bool DependOrigin = false;
std::set<std::string> DependFiles;
std::set<cmTarget*> DependTargets;
- std::string DepFile;
- std::string DepFileRuleName;
+ ConfigString DepFile;
+ ConfigString DepFileRuleName;
// Sources to process
std::unordered_map<cmSourceFile*, MUFileHandle> Headers;
std::unordered_map<cmSourceFile*, MUFileHandle> Sources;