From d9cb571fe126e7e94a52361d733161aa25f23597 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Mon, 30 May 2022 19:30:29 +0200 Subject: Add UnitTestLib target type, for unit-test only libraries. And fix unit-test linkage. --- test/ctor.cc | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) (limited to 'test/ctor.cc') diff --git a/test/ctor.cc b/test/ctor.cc index 6515c72..66f20f2 100644 --- a/test/ctor.cc +++ b/test/ctor.cc @@ -33,7 +33,7 @@ BuildConfigurations ctorTestConfigs() "tasks_test.cc", "testmain.cc", }, - .depends = {"libctor.a"}, + .depends = { "libctor_nomain.a" }, .flags = { .cxxflags = { "-std=c++20", "-O3", "-s", "-Wall", "-Werror", @@ -50,7 +50,7 @@ BuildConfigurations ctorTestConfigs() "source_type_test.cc", "testmain.cc", }, - .depends = {"libctor.a"}, + .depends = { "libctor_nomain.a" }, .flags = { .cxxflags = { "-std=c++20", "-O3", "-s", "-Wall", "-Werror", @@ -60,6 +60,31 @@ BuildConfigurations ctorTestConfigs() .ldflags = { "-pthread" }, }, }, + { + .type = TargetType::UnitTestLib, + .target = "libctor_nomain.a", + .sources = { + "../src/build.cc", + "../src/configure.cc", + "../src/execute.cc", + "../src/rebuild.cc", + "../src/tasks.cc", + "../src/task.cc", + "../src/task_ar.cc", + "../src/task_cc.cc", + "../src/task_ld.cc", + "../src/task_so.cc", + "../src/util.cc", + "../src/externals_manual.cc", + }, + .flags = { + .cxxflags = { + "-std=c++20", "-O3", "-s", "-Wall", "-Werror", + "-I../src", + }, + .ldflags = { "-pthread" }, + }, + }, }; } } -- cgit v1.2.3