diff --git a/CMakeLists.txt b/CMakeLists.txt index 8675cb046..0bfa3838c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -187,7 +187,8 @@ add_executable(c3c src/utils/malloc.c src/utils/stringutils.c src/utils/taskqueue.c - src/utils/toml.c src/build/project.c + src/utils/json.c + src/build/project.c src/utils/vmem.c src/utils/vmem.h src/utils/whereami.c diff --git a/resources/testproject/project.c3p b/resources/testproject/project.c3p new file mode 100644 index 000000000..f13a01548 --- /dev/null +++ b/resources/testproject/project.c3p @@ -0,0 +1,27 @@ +{ + "version": "0.1.0", + "authors": [ + "John Doe " + ], + "langrev": "1", + "warnings": [ + "no-unused" + ], + // sources compiled + "sources": [ + "./**" + ], + // libraries to use + "libs": [], + // c compiler + "cc": "cc", + // c sources + "csources": [ + "./csource/**" + ], + "targets": { + "hello_world": { + "type": "executable", + } + }, +} \ No newline at end of file diff --git a/src/build/build_internal.h b/src/build/build_internal.h index dbd7a0ce5..9aa05f3ac 100644 --- a/src/build/build_internal.h +++ b/src/build/build_internal.h @@ -5,7 +5,7 @@ // a copy of which can be found in the LICENSE file. #include "utils/lib.h" -#include "utils/toml.h" +#include "utils/json.h" #include "build_options.h" #define DEFAULT_SYMTAB_SIZE (2 * 1024 * 1024) #define DEFAULT_SWITCHRANGE_MAX_SIZE (256) diff --git a/src/build/build_options.c b/src/build/build_options.c index 2d89caf16..101225bf1 100644 --- a/src/build/build_options.c +++ b/src/build/build_options.c @@ -85,7 +85,6 @@ static void usage(void) OUTPUT(" -O3 - Aggressive optimization."); OUTPUT(" --emit-llvm - Emit LLVM IR as a .ll file per module."); OUTPUT(" --target - Compile for a particular architecture + OS target."); - OUTPUT(" --target-list - List all architectures the compiler supports."); OUTPUT(" --threads - Set the number of threads to use for compilation."); OUTPUT(" --safe - Set mode to 'safe', generating runtime traps on overflows and contract violations."); OUTPUT(" --fast - Set mode to 'fast', removes runtime traps."); @@ -94,18 +93,14 @@ static void usage(void) OUTPUT(" -g0 - Emit no debug info."); OUTPUT(" -gline-tables-only - Only emit line tables for debugging."); OUTPUT(""); - OUTPUT(" -fpic - Generate position independent (PIC) code if suitable."); - OUTPUT(" -fno-pic - Do not generate position independent code."); - OUTPUT(" -fPIC - Always generate position independent (PIC) code."); - OUTPUT(" -fno-PIC - Generate position independent (PIC) code."); OUTPUT(""); OUTPUT(" -z - Send the as a parameter to the linker."); OUTPUT(""); - OUTPUT(" -mavx - Enable AVX on x64 targets."); - OUTPUT(" -mavx512 - Enable AVX512 on x64 targets."); - OUTPUT(" -mno-avx - Disable AVX on x64 targets."); + OUTPUT(" --reloc=