Add support for adding linking flags
This commit is contained in:
+4
-3
@@ -7,7 +7,7 @@
|
||||
<outputtype>executable</outputtype>
|
||||
<projectname>MakeGen</projectname>
|
||||
<srcdir>src/</srcdir>
|
||||
</configuration>
|
||||
</configuration>
|
||||
<configuration name="Debug">
|
||||
<define>_DEBUG</define>
|
||||
<generatehfile>false</generatehfile>
|
||||
@@ -17,6 +17,7 @@
|
||||
<outputtype>executable</outputtype>
|
||||
<projectname>MakeGen</projectname>
|
||||
<srcdir>src/</srcdir>
|
||||
</configuration>
|
||||
<version>v1.3.0</version>
|
||||
</configuration>
|
||||
<target>Release</target>
|
||||
<version>v1.3.1</version>
|
||||
</makegen>
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@
|
||||
// Release, should be backwards compatible with any minor version
|
||||
#define MAKEGEN_VERSION_RELEASE 3
|
||||
// Minor changes, generally bug fixes
|
||||
#define MAKEGEN_VERSION_MINOR 0
|
||||
#define MAKEGEN_VERSION_MINOR 1
|
||||
|
||||
#define MAKEGEN_VERSION ("v" STR(MAKEGEN_VERSION_MAJOR) "." STR(MAKEGEN_VERSION_RELEASE) "." STR(MAKEGEN_VERSION_MINOR))
|
||||
|
||||
|
||||
+8
-5
@@ -17,11 +17,10 @@ Generating config files
|
||||
|
||||
Modifying config settings
|
||||
add Add values to config settings which support multiple arguments
|
||||
remove Remove values to config settings which support multiple
|
||||
remove Remove values from config settings which support multiple
|
||||
arguments
|
||||
set Set value to config settings which support only one argument
|
||||
|
||||
|
||||
Querying config settings
|
||||
get Get value of the config setting)");
|
||||
}
|
||||
@@ -52,7 +51,8 @@ Valid settings are:
|
||||
librarydir Library directory
|
||||
includedir Include directory
|
||||
define Preprocessor define
|
||||
cflag g++ compiler flags
|
||||
cflag g++ compiler flag
|
||||
lflag g++ linking flag
|
||||
dependency Project which current project depends on)");
|
||||
}
|
||||
|
||||
@@ -68,7 +68,8 @@ Valid settings are
|
||||
librarydir Library directory
|
||||
includedir Include directory
|
||||
define Preprocessor define
|
||||
cflag g++ compiler flags
|
||||
cflag g++ compiler flag
|
||||
lflag g++ linking flag
|
||||
dependency Project which current project depends on)");
|
||||
}
|
||||
|
||||
@@ -105,7 +106,8 @@ Valid settings are:
|
||||
librarydir Library directory
|
||||
includedir Include directory
|
||||
define Preprocessor define
|
||||
cflag g++ compiler flags
|
||||
cflag g++ compiler flag
|
||||
lflag g++ linking flag
|
||||
dependency Project which current project depends on
|
||||
outputdir Directory of the compiled output
|
||||
outputname Name of the output executable/library
|
||||
@@ -131,6 +133,7 @@ ConfigSetting ConfigCLI::CLIStringToSetting(const std::string& s)
|
||||
{"includedir", ConfigSetting::IncludeDir},
|
||||
{"define", ConfigSetting::Define},
|
||||
{"cflag", ConfigSetting::CFlag},
|
||||
{"lflag", ConfigSetting::LFlag},
|
||||
{"dependency", ConfigSetting::Dependency},
|
||||
{"genhfile", ConfigSetting::GenerateHFile},
|
||||
};
|
||||
|
||||
+7
-2
@@ -18,7 +18,7 @@ struct ConfigCache
|
||||
enum class ConfigSetting
|
||||
{
|
||||
// vectors
|
||||
Library = 0, LibraryDir = 1, IncludeDir = 2, Define = 3, CFlag = 4, Dependency = 5,
|
||||
Library = 0, LibraryDir = 1, IncludeDir = 2, Define = 3, Dependency = 4, CFlag = 5, LFlag = 6,
|
||||
// Strings
|
||||
SourceDir = 32, OutputDir = 33, OutputName = 34, OutputType = 35, ProjectName = 36, HFileName = 37,
|
||||
// Bools
|
||||
@@ -57,6 +57,8 @@ struct ConfigUtils
|
||||
return "define";
|
||||
case ConfigSetting::CFlag:
|
||||
return "cflag";
|
||||
case ConfigSetting::LFlag:
|
||||
return "lflag";
|
||||
case ConfigSetting::GenerateHFile:
|
||||
return "generatehfile";
|
||||
case ConfigSetting::Invalid:
|
||||
@@ -66,7 +68,6 @@ struct ConfigUtils
|
||||
|
||||
static bool IsDirectory(ConfigSetting setting)
|
||||
{
|
||||
// Library, LibraryDir, IncludeDir, Define, CFlag, Dependency,
|
||||
switch(setting)
|
||||
{
|
||||
case ConfigSetting::SourceDir:
|
||||
@@ -82,6 +83,7 @@ struct ConfigUtils
|
||||
case ConfigSetting::Library:
|
||||
case ConfigSetting::Define:
|
||||
case ConfigSetting::CFlag:
|
||||
case ConfigSetting::LFlag:
|
||||
case ConfigSetting::GenerateHFile:
|
||||
return false;
|
||||
default:
|
||||
@@ -107,6 +109,7 @@ struct ConfigUtils
|
||||
case ConfigSetting::Library:
|
||||
case ConfigSetting::Define:
|
||||
case ConfigSetting::CFlag:
|
||||
case ConfigSetting::LFlag:
|
||||
case ConfigSetting::GenerateHFile:
|
||||
case ConfigSetting::Invalid:
|
||||
return false;
|
||||
@@ -123,6 +126,7 @@ struct ConfigUtils
|
||||
case ConfigSetting::Library:
|
||||
case ConfigSetting::Define:
|
||||
case ConfigSetting::CFlag:
|
||||
case ConfigSetting::LFlag:
|
||||
return true;
|
||||
case ConfigSetting::SourceDir:
|
||||
case ConfigSetting::OutputDir:
|
||||
@@ -153,6 +157,7 @@ struct ConfigUtils
|
||||
case ConfigSetting::Library:
|
||||
case ConfigSetting::Define:
|
||||
case ConfigSetting::CFlag:
|
||||
case ConfigSetting::LFlag:
|
||||
case ConfigSetting::Invalid:
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -77,7 +77,12 @@ void Makefile::Save(ConfigFile& conf, unsigned int flags)
|
||||
outputFile << "-L./" << *it << " ";
|
||||
}
|
||||
outputFile << std::endl;
|
||||
std::vector<std::string>& lflags = conf.GetSettingVectorString(ConfigSetting::LFlag);
|
||||
outputFile << "LDFLAGS=";
|
||||
for(auto it = lflags.begin(); it != lflags.end(); ++it)
|
||||
{
|
||||
outputFile << *it << " ";
|
||||
}
|
||||
for(auto it = libdirs.begin(); it != libdirs.end(); ++it)
|
||||
{
|
||||
outputFile << "-Wl,-rpath=" << *it << " ";
|
||||
|
||||
Reference in New Issue
Block a user