diff options
author | dec05eba <dec05eba@protonmail.com> | 2018-01-03 20:57:16 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2018-01-03 20:58:01 +0100 |
commit | 469a67628f3eb18236ee44e948d1ae0f0e6b1a4a (patch) | |
tree | 438b19627e5d3ea1ab6324e1a3275c34800079bd | |
parent | add60913a0ff5cd13be18ed594eab6102e78640c (diff) |
Validate cmake.dir is provided in conf
-rw-r--r-- | src/Conf.cpp | 26 | ||||
-rw-r--r-- | src/main.cpp | 3 |
2 files changed, 29 insertions, 0 deletions
diff --git a/src/Conf.cpp b/src/Conf.cpp index 3b0e246..1697d9f 100644 --- a/src/Conf.cpp +++ b/src/Conf.cpp @@ -864,6 +864,32 @@ namespace sibs if(platforms.empty()) throw ParserException("Missing required config package.platforms. If the package supports all platforms, add:\nplatforms = [\"any\"]\nto project.conf under [package]"); + + if(useCmake) + { + switch(getPackageType()) + { + case PackageType::EXECUTABLE: + { + if(!getCmakeDir().empty()) + throw ParserException("Missing required config cmake.dir"); + break; + } + case PackageType::STATIC: + { + if(!getCmakeDirStatic().empty()) + throw ParserException("Missing required config cmake.static"); + break; + } + case PackageType::DYNAMIC: + case PackageType::LIBRARY: + { + if(!getCmakeDirDynamic().empty()) + throw ParserException("Missing required config cmake.dynamic"); + break; + } + } + } } void SibsConfig::validatePackageName() const diff --git a/src/main.cpp b/src/main.cpp index 1297456..e2df0fe 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -40,6 +40,9 @@ using namespace std::chrono; // Might need to make it possible to define variables if a dependency exists (or doesn't exist) because the code might have // preprocessor like: USE_LIBSODIUM or NO_LIBSODIUM. +// TODO: Set c++ standard to c++11 and c standard to c98 - for consistency across different compilers and compiler version. +// It should be possible to override language version in project.conf + #if OS_FAMILY == OS_FAMILY_POSIX #define ferr std::cerr #else |