From f73b507ccbac9fbf2b17ec6bcd1aee613f5362e2 Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Fri, 21 Oct 2022 23:34:34 +0200 Subject: [PATCH] Use project.json instead of .c3p. List project properties. Check project property usage. Change names: lib-dir -> dependency-search-paths, libs -> dependencies, linker-libs -> linked-libraries, linkerlib-dir -> linker-search-paths, csources -> c-sources. Several settings have an xxxx-add, xxxx-override pair for the target, gaining fine grained control over the override. --- .../testproject/{project.c3p => project.json} | 9 +- src/build/build_options.c | 141 +++++----- src/build/build_options.h | 1 + src/build/builder.c | 2 +- src/build/project.c | 253 ++++++++---------- src/build/project_creation.c | 14 +- src/compiler/compiler.c | 17 ++ src/compiler/compiler_internal.h | 5 + src/utils/common.h | 2 +- src/version.h | 2 +- 10 files changed, 219 insertions(+), 227 deletions(-) rename resources/testproject/{project.c3p => project.json} (84%) diff --git a/resources/testproject/project.c3p b/resources/testproject/project.json similarity index 84% rename from resources/testproject/project.c3p rename to resources/testproject/project.json index 04bf05b71..a8613401f 100644 --- a/resources/testproject/project.c3p +++ b/resources/testproject/project.json @@ -12,26 +12,27 @@ "./**" ], // libraries to use - "libs": [], + "dependencies": [], + // c compiler "cc": "cc", // c sources "targets": { "hello_world": { "type": "executable", - "csources-override": [ + "c-sources-override": [ "./csource/**" ] }, "hello_world_win32": { "type": "executable", - "csources-override": [ + "c-sources-override": [ "./csource/**" ] }, "hello_world_lib": { "type": "static-lib", - "csources-override": [ + "c-sources-override": [ "./csource/**" ] }, diff --git a/src/build/build_options.c b/src/build/build_options.c index 8486f4a71..d284afe5f 100644 --- a/src/build/build_options.c +++ b/src/build/build_options.c @@ -76,84 +76,85 @@ static void usage(void) OUTPUT(" headers [ ...] Analyse files and generate C headers for public methods."); OUTPUT(""); OUTPUT("Options:"); - OUTPUT(" --tinybackend - Use the TinyBackend for compilation."); - OUTPUT(" --stdlib - Use this directory as the C3 standard library path."); - OUTPUT(" --nostdlib - Do not include the standard library."); - OUTPUT(" --nolibc - Do not implicitly link libc nor any associated files."); - OUTPUT(" --libdir - Add this directory to the C3 library search paths."); - OUTPUT(" --lib - Add this library to the compilation."); - OUTPUT(" --path - Use this as the base directory for the current command."); - OUTPUT(" --template