From 469a67628f3eb18236ee44e948d1ae0f0e6b1a4a Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 3 Jan 2018 20:57:16 +0100 Subject: Validate cmake.dir is provided in conf --- src/Conf.cpp | 26 ++++++++++++++++++++++++++ src/main.cpp | 3 +++ 2 files changed, 29 insertions(+) (limited to 'src') 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 -- cgit v1.2.3