From 658d6df8a531c8c14e197b9525c3905c8fb60892 Mon Sep 17 00:00:00 2001 From: Thraix Date: Wed, 4 Jun 2025 22:20:09 +0200 Subject: [PATCH] Add includedirexcldep makgen.xml flag - New flag is used to add include directories without making them part of the include dependency graph. - Can be used to remove dependency graphs for include directories that aren't generally modified, like operating system library include directories --- Makefile | 2 +- makegen.xml | 2 +- src/Common.h | 2 +- src/ConfigFile.cpp | 1 - src/ConfigUtils.h | 8 +++++++- src/Makefile.cpp | 5 +++++ 6 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 3cd4996..11ad938 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -# This Makefile was generated using MakeGen v1.3.4 made by Tim HÃ¥kansson +# This Makefile was generated using MakeGen v1.3.5 made by Tim HÃ¥kansson # and is licensed under MIT. Full source of the project can be found at # https://github.com/Thraix/MakeGen CC=@g++ diff --git a/makegen.xml b/makegen.xml index 08cd2b3..8279028 100644 --- a/makegen.xml +++ b/makegen.xml @@ -19,5 +19,5 @@ src/ Release - v1.3.4 + v1.3.5 diff --git a/src/Common.h b/src/Common.h index 71d3e62..b8d88b4 100755 --- a/src/Common.h +++ b/src/Common.h @@ -14,7 +14,7 @@ // Release, should be backwards compatible with any minor version #define MAKEGEN_VERSION_RELEASE 3 // Minor changes, generally bug fixes -#define MAKEGEN_VERSION_MINOR 4 +#define MAKEGEN_VERSION_MINOR 5 #define MAKEGEN_VERSION ("v" STR(MAKEGEN_VERSION_MAJOR) "." STR(MAKEGEN_VERSION_RELEASE) "." STR(MAKEGEN_VERSION_MINOR)) diff --git a/src/ConfigFile.cpp b/src/ConfigFile.cpp index 0f61b0d..b844f95 100755 --- a/src/ConfigFile.cpp +++ b/src/ConfigFile.cpp @@ -4,7 +4,6 @@ #include "compatibility/ConfigFileConf.h" #include "xml/XML.h" -#include #include ConfigFile::ConfigFile(const std::string& path, int) diff --git a/src/ConfigUtils.h b/src/ConfigUtils.h index 6a9d1e9..3b72420 100644 --- a/src/ConfigUtils.h +++ b/src/ConfigUtils.h @@ -18,7 +18,7 @@ struct ConfigCache enum class ConfigSetting { // vectors - Library = 0, LibraryDir = 1, IncludeDir = 2, Define = 3, Dependency = 4, CFlag = 5, LFlag = 6, ExcludeSource = 7, ExcludeHeader = 8, ExecPreArgument = 9, ExecArgument = 10, SourceFile = 11, + Library = 0, LibraryDir = 1, IncludeDir = 2, Define = 3, Dependency = 4, CFlag = 5, LFlag = 6, ExcludeSource = 7, ExcludeHeader = 8, ExecPreArgument = 9, ExecArgument = 10, SourceFile = 11, IncludeDirExclDep = 12, // Strings SourceDir = 32, OutputDir = 33, OutputName = 34, OutputType = 35, ProjectName = 36, HFileName = 37, // Bools @@ -71,6 +71,8 @@ struct ConfigUtils return "generatehfile"; case ConfigSetting::SourceFile: return "sourcefile"; + case ConfigSetting::IncludeDirExclDep: + return "includedirexcldep"; case ConfigSetting::Invalid: return "invalid"; } @@ -86,6 +88,7 @@ struct ConfigUtils case ConfigSetting::LibraryDir: case ConfigSetting::IncludeDir: case ConfigSetting::Dependency: + case ConfigSetting::IncludeDirExclDep: return true; case ConfigSetting::OutputName: case ConfigSetting::OutputType: @@ -131,6 +134,7 @@ struct ConfigUtils case ConfigSetting::ExecArgument: case ConfigSetting::GenerateHFile: case ConfigSetting::SourceFile: + case ConfigSetting::IncludeDirExclDep: case ConfigSetting::Invalid: return false; } @@ -153,6 +157,7 @@ struct ConfigUtils case ConfigSetting::ExecPreArgument: case ConfigSetting::ExecArgument: case ConfigSetting::SourceFile: + case ConfigSetting::IncludeDirExclDep: return true; case ConfigSetting::SourceDir: case ConfigSetting::OutputDir: @@ -191,6 +196,7 @@ struct ConfigUtils case ConfigSetting::ExecArgument: case ConfigSetting::SourceFile: case ConfigSetting::Invalid: + case ConfigSetting::IncludeDirExclDep: return false; } return false; diff --git a/src/Makefile.cpp b/src/Makefile.cpp index 85968c9..95bb7d3 100755 --- a/src/Makefile.cpp +++ b/src/Makefile.cpp @@ -41,6 +41,11 @@ void Makefile::Save(ConfigFile& conf, unsigned int flags) { outputFile << "-I " << *it << " "; } + std::vector& includedirsexcldep = conf.GetSettingVectorString(ConfigSetting::IncludeDirExclDep); + for(auto it = includedirsexcldep.begin(); it != includedirsexcldep.end(); ++it) + { + outputFile << "-I " << *it << " "; + } outputFile << std::endl; outputFile << "OBJECTS="; for(auto it = cppFiles.begin();it!=cppFiles.end();++it)