diff options
author | dec05eba <dec05eba@protonmail.com> | 2018-03-18 10:28:36 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2018-03-18 10:28:45 +0100 |
commit | 2a8f23ff8aa29514d8e003ecce1808aa242af292 (patch) | |
tree | 525a18f195e421bd794d25db08004c0db93f4835 /src | |
parent | 16ae8338d9227ba9b06694c199e7aedec11d4ef5 (diff) |
Fix crash when building project with no source files
Diffstat (limited to 'src')
-rw-r--r-- | src/main.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp index c0d02d5..b9d6c1b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -79,6 +79,14 @@ using namespace std::chrono; // TODO (bug): Fix issue where running sibs-build in a project that uses cmake wont build and run tests +// TODO: Add 'license' in project.conf. License must be commonly known license or 'custom'. +// 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. +// 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) + #if OS_FAMILY == OS_FAMILY_POSIX #define ferr std::cerr #else @@ -449,6 +457,7 @@ void newProjectCreateConf(const string &projectName, const string &projectType, projectConfStr += "platforms = [\""; projectConfStr += asString(SYSTEM_PLATFORM); projectConfStr += "\"]\n"; + projectConfStr += "tests = \"tests\""; projectConfStr += "\n"; projectConfStr += "[dependencies]\n"; @@ -524,7 +533,8 @@ int newProject(int argc, const _tinydir_char_t **argv) createProjectSubDir(projectPath + TINYDIR_STRING("/src")); createProjectSubDir(projectPath + TINYDIR_STRING("/include")); createProjectSubDir(projectPath + TINYDIR_STRING("/tests")); - createProjectFile(projectPath + TINYDIR_STRING("/src/main.cpp"), "#include <cstdio>\n\nint main(int argc, char **argv)\n{\n printf(\"hello, world!\\n\");\n return 0;\n}\n"); + if(projectTypeConf == "executable") + createProjectFile(projectPath + TINYDIR_STRING("/src/main.cpp"), "#include <cstdio>\n\nint main(int argc, char **argv)\n{\n printf(\"hello, world!\\n\");\n return 0;\n}\n"); // We are ignoring git init result on purpose. If it fails, just ignore it; not important gitInitProject(projectPath); return 0; |