diff options
| author | Lexi Winter <lexi@le-fay.org> | 2025-06-28 17:43:28 +0100 |
|---|---|---|
| committer | Lexi Winter <lexi@le-fay.org> | 2025-06-28 17:43:28 +0100 |
| commit | f226d46ee02b57dd76a4793593aa8d66e1c58353 (patch) | |
| tree | acf2aeb5edddb3eef74b9751312cdd417ee63624 | |
| parent | 2df6a302882027ff52162a6c1dd2f67547c1ac31 (diff) | |
| download | nihil-f226d46ee02b57dd76a4793593aa8d66e1c58353.tar.gz nihil-f226d46ee02b57dd76a4793593aa8d66e1c58353.tar.bz2 | |
nihil: move uuid to its own module
| -rw-r--r-- | CMakeLists.txt | 1 | ||||
| -rw-r--r-- | nihil.uuid/CMakeLists.txt | 23 | ||||
| -rw-r--r-- | nihil.uuid/test.cc (renamed from nihil/tests/uuid.cc) | 2 | ||||
| -rw-r--r-- | nihil.uuid/uuid.ccm (renamed from nihil/uuid.ccm) | 2 | ||||
| -rw-r--r-- | nihil/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | nihil/nihil.ccm | 1 | ||||
| -rw-r--r-- | nihil/tests/CMakeLists.txt | 1 |
7 files changed, 26 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 435f7ee..9a2b6ab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,6 +19,7 @@ add_compile_options(-Werror) add_compile_options(-Wpedantic) add_subdirectory(nihil.flagset) +add_subdirectory(nihil.uuid) add_subdirectory(nihil) if(NIHIL_UCL) diff --git a/nihil.uuid/CMakeLists.txt b/nihil.uuid/CMakeLists.txt new file mode 100644 index 0000000..fe037e7 --- /dev/null +++ b/nihil.uuid/CMakeLists.txt @@ -0,0 +1,23 @@ +# This source code is released into the public domain. + +add_library(nihil.uuid STATIC) +target_sources(nihil.uuid + PUBLIC FILE_SET modules TYPE CXX_MODULES FILES + uuid.ccm +) + +if(NIHIL_TESTS) + enable_testing() + + add_executable(nihil.uuid.test test.cc) + target_link_libraries(nihil.uuid.test PRIVATE + nihil.uuid + Catch2::Catch2WithMain + ) + + find_package(Catch2 REQUIRED) + + include(CTest) + include(Catch) + catch_discover_tests(nihil.uuid.test) +endif() diff --git a/nihil/tests/uuid.cc b/nihil.uuid/test.cc index dabbca6..04a6ab5 100644 --- a/nihil/tests/uuid.cc +++ b/nihil.uuid/test.cc @@ -57,7 +57,7 @@ void seed_rng(EngineT& engine) } // anonymous namespace -import nihil; +import nihil.uuid; using namespace nihil; diff --git a/nihil/uuid.ccm b/nihil.uuid/uuid.ccm index 68968ae..0c46b60 100644 --- a/nihil/uuid.ccm +++ b/nihil.uuid/uuid.ccm @@ -43,7 +43,7 @@ module; #include <string_view> #include <type_traits> -export module nihil:uuid; +export module nihil.uuid; namespace nihil { diff --git a/nihil/CMakeLists.txt b/nihil/CMakeLists.txt index 49955c8..64dbe6a 100644 --- a/nihil/CMakeLists.txt +++ b/nihil/CMakeLists.txt @@ -29,7 +29,6 @@ target_sources(nihil spawn.ccm tabulate.ccm usage_error.ccm - uuid.ccm write_file.ccm PRIVATE diff --git a/nihil/nihil.ccm b/nihil/nihil.ccm index 7d2ac7f..cbcadaf 100644 --- a/nihil/nihil.ccm +++ b/nihil/nihil.ccm @@ -31,5 +31,4 @@ export import :skipws; export import :spawn; export import :tabulate; export import :usage_error; -export import :uuid; export import :write_file; diff --git a/nihil/tests/CMakeLists.txt b/nihil/tests/CMakeLists.txt index a57d844..dd2d376 100644 --- a/nihil/tests/CMakeLists.txt +++ b/nihil/tests/CMakeLists.txt @@ -14,7 +14,6 @@ add_executable(nihil.test skipws.cc spawn.cc tabulate.cc - uuid.cc ) target_link_libraries(nihil.test PRIVATE |
