From 017ec45e94204f977dcd7b04c8035d48f230ded3 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 31 Dec 2017 05:24:40 +0100 Subject: 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 !!! --- include/Conf.hpp | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 65 insertions(+), 1 deletion(-) (limited to 'include/Conf.hpp') 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 &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& getGlobalIncludeDirs() const + { + return exposeIncludeDirs; + } + + virtual const std::vector& getPlatforms() const + { + return platforms; + } + virtual OptimizationLevel getOptimizationLevel() const { return optimizationLevel; } + + const std::vector& getDebugStaticLibs() const + { + return debugStaticLibs; + } + + const std::vector& getReleaseStaticLibs() const + { + return releaseStaticLibs; + } void setPackageType(PackageType packageType) { @@ -170,15 +230,19 @@ namespace sibs PackageType packageType; std::vector dependencies; std::vector includeDirs; + std::vector exposeIncludeDirs; + std::vector platforms; std::unordered_map defines; OptimizationLevel optimizationLevel; + std::vector debugStaticLibs; + std::vector 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"; } -- cgit v1.2.3