From cfe578ec12198d09a9a89a2e0b40bccaa06aa8ae Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 11 Dec 2017 20:19:28 +0100 Subject: Add package type to project.conf Type can be either executable or library. Executable: project compiles to an executable binary. Library: project compiles to either a static or dynamic library, depending on what how the dependent project wants the dependency to compile. With having type in project.conf, you cant include wrong type of project (an executable including another executable, conflicting main functions). --- src/GlobalLib.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/GlobalLib.cpp') diff --git a/src/GlobalLib.cpp b/src/GlobalLib.cpp index cbd822e..7503a7a 100644 --- a/src/GlobalLib.cpp +++ b/src/GlobalLib.cpp @@ -111,6 +111,14 @@ namespace sibs if(sibsConfig.getPackageName().empty()) return Result::Err("project.conf is missing required field package.name"); + if(sibsConfig.getPackageType() == PackageType::EXECUTABLE) + { + string errMsg = "The dependency "; + errMsg += name; + errMsg += " is an executable. Only libraries can be dependencies"; + return Result::Err(errMsg); + } + backend::Ninja ninja(backend::Ninja::LibraryType::STATIC); walkDirFilesRecursive(packageDir.c_str(), [&ninja, &packageDir](tinydir_file *file) { -- cgit v1.2.3