Commit fc1aaf14 authored by Brad King's avatar Brad King Committed by Kitware Robot
Browse files

Merge topic 'autogen-optimize-cleanup'

8e452e67 Remove AUTOGEN variables from cmSourceFile and cmMakefile
0f2e178f Autogen: Don't use cmMakefile::GetQtUiFilesWithOptions
13bb716f Autogen: Fix and extend SKIP_AUTOMOC test
727247c3 Autogen: Read skip files from makefile
1eb1b409 Autogen: Remove VS specific code exclusion
54ec2a8b Autogen: Initializer file type scanning optimizations
cf7b3b96

 Autogen: Initializer optimizations and cleanups
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !1171
parents ac6660b6 8e452e67
Pipeline #69320 failed with stage
in 0 seconds
......@@ -4,7 +4,7 @@ set(AM_CMAKE_SOURCE_DIR "@CMAKE_SOURCE_DIR@/")
set(AM_CMAKE_CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@/")
set(AM_CMAKE_CURRENT_BINARY_DIR "@CMAKE_CURRENT_BINARY_DIR@/")
set(AM_CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE "@CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE@")
set(AM_BUILD_DIR @_autogen_build_dir@)
set(AM_BUILD_DIR @_build_dir@)
set(AM_SOURCES @_sources@)
set(AM_HEADERS @_headers@)
# Qt environment
......
......@@ -3902,16 +3902,6 @@ bool cmMakefile::EnforceUniqueDir(const std::string& srcPath,
return false;
}
void cmMakefile::AddQtUiFileWithOptions(cmSourceFile* sf)
{
this->QtUiFilesWithOptions.push_back(sf);
}
std::vector<cmSourceFile*> cmMakefile::GetQtUiFilesWithOptions() const
{
return this->QtUiFilesWithOptions;
}
static std::string const matchVariables[] = {
"CMAKE_MATCH_0", "CMAKE_MATCH_1", "CMAKE_MATCH_2", "CMAKE_MATCH_3",
"CMAKE_MATCH_4", "CMAKE_MATCH_5", "CMAKE_MATCH_6", "CMAKE_MATCH_7",
......
......@@ -736,9 +736,6 @@ public:
cmStringRange GetCompileDefinitionsEntries() const;
cmBacktraceRange GetCompileDefinitionsBacktraces() const;
void AddQtUiFileWithOptions(cmSourceFile* sf);
std::vector<cmSourceFile*> GetQtUiFilesWithOptions() const;
std::set<std::string> const& GetSystemIncludeDirectories() const
{
return this->SystemIncludeDirectories;
......@@ -917,8 +914,6 @@ private:
void UpdateOutputToSourceMap(std::string const& output,
cmSourceFile* source);
std::vector<cmSourceFile*> QtUiFilesWithOptions;
bool AddRequiredTargetCFeature(cmTarget* target, const std::string& feature,
std::string* error = CM_NULLPTR) const;
......
This diff is collapsed.
......@@ -11,7 +11,7 @@ class cmLocalGenerator;
class cmQtAutoGeneratorInitializer
{
public:
static void InitializeAutogenTarget(cmLocalGenerator* lg,
static void InitializeAutogenTarget(cmLocalGenerator* localGen,
cmGeneratorTarget* target);
static void SetupAutoGenerateTarget(cmGeneratorTarget const* target);
};
......
......@@ -17,8 +17,6 @@ cmSourceFile::cmSourceFile(cmMakefile* mf, const std::string& name)
{
this->CustomCommand = CM_NULLPTR;
this->FindFullPathFailed = false;
this->IsUiFile = (".ui" == cmSystemTools::GetFilenameLastExtension(
this->Location.GetName()));
}
cmSourceFile::~cmSourceFile()
......@@ -245,13 +243,6 @@ bool cmSourceFile::Matches(cmSourceFileLocation const& loc)
void cmSourceFile::SetProperty(const std::string& prop, const char* value)
{
this->Properties.SetProperty(prop, value);
if (this->IsUiFile) {
cmMakefile const* mf = this->Location.GetMakefile();
if (prop == "AUTOUIC_OPTIONS") {
const_cast<cmMakefile*>(mf)->AddQtUiFileWithOptions(this);
}
}
}
void cmSourceFile::AppendProperty(const std::string& prop, const char* value,
......
......@@ -107,7 +107,6 @@ private:
std::string ObjectLibrary;
std::vector<std::string> Depends;
bool FindFullPathFailed;
bool IsUiFile;
bool FindFullPath(std::string* error);
bool TryFullPath(const std::string& path, const std::string& ext);
......
......@@ -114,16 +114,27 @@ target_compile_features(empty PRIVATE ${QT_COMPILE_FEATURES})
# -- Test
# Test for SKIP_AUTOMOC and SKIP_AUTOGEN on an AUTOMOC enabled target
if(ALLOW_WRAP_CPP)
# Generate header mocs manually
qtx_wrap_cpp(skipMocWrapMoc
skipSource/qItemA.hpp
skipSource/qItemB.hpp)
skipSource/qItemB.hpp
skipSource/qItemC.hpp
skipSource/qItemD.hpp
)
set(skipMocSources
skipMoc.cpp
skipSource/qItemA.cpp
skipSource/qItemB.cpp
skipSource/qItemC.cpp)
skipSource/qItemC.cpp
skipSource/qItemD.cpp
)
# When cpp files are skipped, the hpp won't be processed either,
# unless they are mentioned in the sources - which they aren't.
set_property(SOURCE skipSource/qItemA.cpp PROPERTY SKIP_AUTOMOC ON)
set_property(SOURCE skipSource/qItemB.cpp PROPERTY SKIP_AUTOGEN ON)
# When hpp files are skipped, the cpp still get processed.
set_property(SOURCE skipSource/qItemC.hpp PROPERTY SKIP_AUTOMOC ON)
set_property(SOURCE skipSource/qItemD.hpp PROPERTY SKIP_AUTOGEN ON)
# AUTOMOC enabled only
add_executable(skipMocA ${skipMocSources} ${skipMocWrapMoc})
set_property(TARGET skipMocA PROPERTY AUTOMOC ON)
......
......@@ -2,12 +2,14 @@
#include "skipSource/qItemA.hpp"
#include "skipSource/qItemB.hpp"
#include "skipSource/qItemC.hpp"
#include "skipSource/qItemD.hpp"
int main(int, char**)
{
QItemA itemA;
QItemA itemB;
QItemA itemC;
QItemB itemB;
QItemC itemC;
QItemD itemD;
// Fails to link if the symbol is not present.
return 0;
......
#include "qItemC.hpp"
class QItemC_Local : public QObject
{
Q_OBJECT
public:
QItemC_Local(){};
~QItemC_Local(){};
};
void QItemC::go()
{
QItemC_Local localObject;
}
// We need AUTOMOC processing
#include "qItemC.moc"
#include "qItemD.hpp"
class QItemD_Local : public QObject
{
Q_OBJECT
public:
QItemD_Local(){};
~QItemD_Local(){};
};
void QItemD::go()
{
QItemD_Local localObject;
}
// We need AUTOMOC processing
#include "qItemD.moc"
#ifndef QITEMD_HPP
#define QITEMD_HPP
#include <QObject>
class QItemD : public QObject
{
Q_OBJECT
Q_SLOT
void go();
};
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment