diff options
author | dec05eba <dec05eba@protonmail.com> | 2017-12-31 05:24:40 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2017-12-31 05:26:07 +0100 |
commit | 017ec45e94204f977dcd7b04c8035d48f230ded3 (patch) | |
tree | 7778ecc069f05fb527329f36876ed13a17a48ab3 /include/Conf.hpp | |
parent | 7a5910121ab0ad2ea8a4a60e5b6599b7255e5a5e (diff) |
Sibs can now build itself on windows
Fixed several bugs.
The windows implementation IS QUICK AND DIRTY! It links
things as static even if you wish to link as dynamic etc.....
NEED TO FIX THIS !!!
Diffstat (limited to 'include/Conf.hpp')
-rw-r--r-- | include/Conf.hpp | 66 |
1 files changed, 65 insertions, 1 deletions
diff --git a/include/Conf.hpp b/include/Conf.hpp index d147fca..2cb387c 100644 --- a/include/Conf.hpp +++ b/include/Conf.hpp @@ -99,6 +99,46 @@ namespace sibs MSVC }; + enum Platform + { + PLATFORM_ANY, + + PLATFORM_LINUX32, + PLATFORM_LINUX64, + + PLATFORM_WIN32, + PLATFORM_WIN64 + }; + + // TODO: Detect this at runtime? + #if OS_TYPE == OS_TYPE_WINDOWS + #ifdef SIBS_ENV_32BIT + const Platform SYSTEM_PLATFORM = Platform::PLATFORM_WIN32; + const StringView CONFIG_SYSTEM_PLATFORM = "config.win32"; + const StringView CONFIG_STATIC_DEBUG_PLATFORM = "config.win32.static.debug"; + const StringView CONFIG_STATIC_RELEASE_PLATFORM = "config.win32.static.release"; + #else + const Platform SYSTEM_PLATFORM = Platform::PLATFORM_WIN64; + const StringView CONFIG_SYSTEM_PLATFORM = "config.win64"; + const StringView CONFIG_STATIC_DEBUG_PLATFORM = "config.win64.static.debug"; + const StringView CONFIG_STATIC_RELEASE_PLATFORM = "config.win64.static.release"; + #endif + #elif OS_TYPE == OS_TYPE_LINUX + #ifdef SIBS_ENV_32BIT + const Platform SYSTEM_PLATFORM = Platform::PLATFORM_LINUX32; + const StringView CONFIG_SYSTEM_PLATFORM = "config.linux32"; + const StringView CONFIG_STATIC_DEBUG_PLATFORM = "config.linux32.static.debug"; + const StringView CONFIG_STATIC_RELEASE_PLATFORM = "config.linux32.static.release"; + #else + const Platform SYSTEM_PLATFORM = Platform::PLATFORM_LINUX64; + const StringView CONFIG_SYSTEM_PLATFORM = "config.linux64"; + const StringView CONFIG_STATIC_DEBUG_PLATFORM = "config.linux64.static.debug"; + const StringView CONFIG_STATIC_RELEASE_PLATFORM = "config.linux64.static.release"; + #endif + #endif + + bool containsPlatform(const std::vector<Platform> &platforms, Platform platform); + const char* asString(Platform platform); const char* asString(OptimizationLevel optLevel); class SibsConfig : public ConfigCallback @@ -144,10 +184,30 @@ namespace sibs return includeDirs; } + virtual const std::vector<std::string>& getGlobalIncludeDirs() const + { + return exposeIncludeDirs; + } + + virtual const std::vector<Platform>& getPlatforms() const + { + return platforms; + } + virtual OptimizationLevel getOptimizationLevel() const { return optimizationLevel; } + + const std::vector<std::string>& getDebugStaticLibs() const + { + return debugStaticLibs; + } + + const std::vector<std::string>& getReleaseStaticLibs() const + { + return releaseStaticLibs; + } void setPackageType(PackageType packageType) { @@ -170,15 +230,19 @@ namespace sibs PackageType packageType; std::vector<Dependency> dependencies; std::vector<std::string> includeDirs; + std::vector<std::string> exposeIncludeDirs; + std::vector<Platform> platforms; std::unordered_map<std::string, std::string> defines; OptimizationLevel optimizationLevel; + std::vector<std::string> debugStaticLibs; + std::vector<std::string> releaseStaticLibs; bool finishedProcessing; }; class SibsTestConfig : public SibsConfig { public: - SibsTestConfig(Compiler _compiler, const FileString &_projectPath) : SibsConfig(_compiler, _projectPath) + SibsTestConfig(Compiler _compiler, const FileString &_projectPath, OptimizationLevel _optimizationLevel) : SibsConfig(_compiler, _projectPath, _optimizationLevel) { packageName = "test"; } |