aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-05-05 15:11:17 +0200
committerdec05eba <dec05eba@protonmail.com>2018-05-05 15:11:19 +0200
commita4e3a1191949449d1fda319771c725fdaa6f8b75 (patch)
tree903f5101c20bbaaa5c9f492c680163cde2db9783 /src
parent8d3a83a20a57cd505b2f98a542903a3aee0c2b45 (diff)
Build compilation database (clangdb) when compiling
Diffstat (limited to 'src')
-rw-r--r--src/CmakeModule.cpp1
-rw-r--r--src/main.cpp6
2 files changed, 6 insertions, 1 deletions
diff --git a/src/CmakeModule.cpp b/src/CmakeModule.cpp
index 99be269..6313eb0 100644
--- a/src/CmakeModule.cpp
+++ b/src/CmakeModule.cpp
@@ -141,6 +141,7 @@ namespace sibs
}
}
//cmd += TINYDIR_STRING(" -DCMAKE_SKIP_RPATH=\"1\"");
+ cmd += TINYDIR_STRING(" -DCMAKE_EXPORT_COMPILE_COMMANDS");
cmd += TINYDIR_STRING(" \"-B");
cmd += buildPath;
cmd += TINYDIR_STRING("\" \"-H");
diff --git a/src/main.cpp b/src/main.cpp
index 441ec2f..db57648 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -79,12 +79,16 @@ using namespace std::chrono;
// This is to include lgpl dependencies as dynamic libraries and give error if you are using gpl dependencies in a non gpl project.
// If the license type is custom, then the ways the library can be used should be defined in such a way that dependent projects can determinate
// if the dependency can be used without breaking compatibility between licenses.
+// License notice has to be in a file called LICENSE or COPYING in the root directory of the project and these files will be combined automatically
+// for all dependencies when releasing your software, as including license with software is often required.
// TODO: Dynamically link libgit2 (sibs dependency) since it's under lgpl license. Optionally implement git clone/pull with MIT license.
// TODO: Auto export all symbols under windows (https://stackoverflow.com/questions/225432/export-all-symbols-when-creating-a-dll)
// TODO: Fix issue where when you have a dependency on a cmake project with dynamic library, the dynamic library wont be found at runtime for whatever reason
+// TODO: Add program command for generating compile_commands.json without compiling code, without using Ninja
+
#if OS_FAMILY == OS_FAMILY_POSIX
#define ferr std::cerr
#else
@@ -259,7 +263,7 @@ int buildProject(const FileString &projectPath, const FileString &projectConfFil
}
backend::BackendUtils::collectSourceFiles(projectPath.c_str(), &ninja, sibsConfig);
-
+ sibsConfig.setMainProject(true);
Result<bool> buildFileResult = ninja.build(sibsConfig, buildPath.c_str());
if(buildFileResult.isErr())
{