From 5006226e945fc645e6d9b21252c9eee53cc191cc Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 23 Sep 2018 12:22:37 +0200 Subject: Fix various things, add generated zig header files to global include Fix compile_commands.json missing build steps. Fix c includes -> zig includes flags. Fix crash when running sibs new/init without defining lang. Add generated zig header files to global include so they can be used from c/c++. Add zig and zig/c (using zig and c in the same project) examples. --- src/main.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index b232d93..0d29a75 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -701,6 +701,9 @@ int initProject(int argc, const _tinydir_char_t **argv) ferr << "Error: Project type not defined, expected to be either --exec, --static or --dynamic" << endl; usageInit(); } + + if(!lang) + lang = TINYDIR_STRING("c++"); string projectTypeConf; if(_tinydir_strcmp(projectType, TINYDIR_STRING("--exec")) == 0) @@ -714,9 +717,6 @@ int initProject(int argc, const _tinydir_char_t **argv) ferr << "Expected project type to be either --exec, --static or --dynamic; was: " << projectType << endl << endl; usageInit(); } - - if(!lang) - lang = TINYDIR_STRING("c++"); // TODO: If projectPath is not defined and working directory does not contain project.conf, then search every parent directory until one is found if(projectPath.empty()) @@ -920,6 +920,9 @@ int newProject(int argc, const _tinydir_char_t **argv) ferr << "Error: Project type not defined, expected to be either --exec, --static or --dynamic" << endl; usageNew(); } + + if(!lang) + lang = TINYDIR_STRING("c++"); string projectTypeConf; if(_tinydir_strcmp(projectType, TINYDIR_STRING("--exec")) == 0) -- cgit v1.2.3