diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 424c57829..94d7d73ab 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -35,6 +35,11 @@ jobs: cd resources/testproject ..\..\build\${{ matrix.build_type }}\c3c.exe --debug-log run hello_world_win32 + - name: Build testproject lib + run: | + cd resources/testproject + ..\..\build\${{ matrix.build_type }}\c3c.exe --debug-log build hello_world_win32_lib + - name: run compiler tests run: | cd test @@ -79,6 +84,11 @@ jobs: cd resources/testproject ../../build/c3c run --debug-log + - name: Build testproject lib + run: | + cd resources/testproject + ../../build/c3c build hello_world_lib --debug-log + - name: run compiler tests run: | cd test @@ -110,11 +120,17 @@ jobs: run: | cmake -B build -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} cmake --build build + - name: Build testproject run: | cd resources/testproject ../../build/c3c run --debug-log + - name: Build testproject lib + run: | + cd resources/testproject + ../../build/c3c build hello_world_lib --debug-log + - name: run compiler tests run: | cd test @@ -232,6 +248,11 @@ jobs: cd resources/testproject ../../build/c3c run --debug-log --forcelinker + - name: Build testproject lib + run: | + cd resources/testproject + ../../build/c3c build hello_world_lib --debug-log + - name: run compiler tests run: | cd test diff --git a/resources/testproject/project.c3p b/resources/testproject/project.c3p index 284544d76..52fb94f6d 100644 --- a/resources/testproject/project.c3p +++ b/resources/testproject/project.c3p @@ -25,7 +25,18 @@ }, "hello_world_win32": { "type": "executable", + "csources": [ + "./csource/**" + ] + }, + "hello_world_lib": { + "type": "static-lib", + "csources": [ + "./csource/**" + ] + }, + "hello_world_win32_lib": { + "type": "static-lib", } - }, } \ No newline at end of file diff --git a/src/build/build_options.c b/src/build/build_options.c index 8aaa4dcc3..53ffb9fa6 100644 --- a/src/build/build_options.c +++ b/src/build/build_options.c @@ -70,6 +70,8 @@ static void usage(void) OUTPUT(" bench [] Benchmark a target."); OUTPUT(" clean-run [] Clean, then run the target."); OUTPUT(" compile-run [ ...] Compile files then immediately run the result."); + OUTPUT(" static-lib [ ...] Compile files without a project into a static library."); + OUTPUT(" dynamic-lib [ ...] Compile files without a project into a dynamic library."); OUTPUT(" headers [ ...] Analyse files and generate C headers for public methods."); OUTPUT(""); OUTPUT("Options:"); @@ -111,7 +113,7 @@ static void usage(void) OUTPUT(" -l - Link with the library provided."); OUTPUT(" -L - Append the directory to the linker search paths."); OUTPUT(" -z - Send the as a parameter to the linker."); - OUTPUT(" --forcelinker - Force linker usage over using when doing non-cross linking."); + OUTPUT(" --forcelinker - Force built in linker usage when doing non-cross linking."); OUTPUT(""); OUTPUT(" --reloc=