aboutsummaryrefslogtreecommitdiff
path: root/include/Conf.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/Conf.hpp')
-rw-r--r--include/Conf.hpp66
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";
}