From 30c4346f04117b5a50ad95365cd199b8e80eec21 Mon Sep 17 00:00:00 2001 From: John Kerl Date: Wed, 20 Nov 2024 22:16:19 -0500 Subject: [PATCH] move cpp20 things to `cpp20` subdir --- CMakeLists.txt | 2 -- cpp20/CMakeLists.txt | 29 +++++++++++++++++++++ {spffl20 => cpp20/spffl}/CMakeLists.txt | 0 {spffl20 => cpp20/spffl}/README.md | 0 {spffl20 => cpp20/spffl}/mod/CMakeLists.txt | 0 {spffl20 => cpp20/spffl}/mod/foo.cpp | 0 {spffl20 => cpp20/spffl}/mod/foo.h | 0 {test20 => cpp20/test}/CMakeLists.txt | 0 cpp20/test/README.md | 1 + {test20 => cpp20/test}/mod/CMakeLists.txt | 2 +- cpp20/test/mod/test_mod.cpp | 7 +++++ test20/README.md | 1 - test20/mod/test_mod.cpp | 7 ----- 13 files changed, 38 insertions(+), 11 deletions(-) create mode 100644 cpp20/CMakeLists.txt rename {spffl20 => cpp20/spffl}/CMakeLists.txt (100%) rename {spffl20 => cpp20/spffl}/README.md (100%) rename {spffl20 => cpp20/spffl}/mod/CMakeLists.txt (100%) rename {spffl20 => cpp20/spffl}/mod/foo.cpp (100%) rename {spffl20 => cpp20/spffl}/mod/foo.h (100%) rename {test20 => cpp20/test}/CMakeLists.txt (100%) create mode 100644 cpp20/test/README.md rename {test20 => cpp20/test}/mod/CMakeLists.txt (98%) create mode 100644 cpp20/test/mod/test_mod.cpp delete mode 100644 test20/README.md delete mode 100644 test20/mod/test_mod.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index d6d71e2..b17c01f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,14 +12,12 @@ set(CMAKE_CXX_STANDARD 20 CACHE STRING "C++ Standard") set(CMAKE_CXX_STANDARD_REQUIRED ON) add_subdirectory(spffl) -add_subdirectory(spffl20) add_subdirectory(lib) add_subdirectory(cli) enable_testing() set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/") add_subdirectory(test) -add_subdirectory(test20) # ---------------------------------------------------------------- install( diff --git a/cpp20/CMakeLists.txt b/cpp20/CMakeLists.txt new file mode 100644 index 0000000..211dc3f --- /dev/null +++ b/cpp20/CMakeLists.txt @@ -0,0 +1,29 @@ +cmake_minimum_required (VERSION 3.24) + +project(spffl20) + +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE Release) +endif() + +set(CMAKE_CXX_FLAGS_RELEASE "-O2") + +set(CMAKE_CXX_STANDARD 20 CACHE STRING "C++ Standard") +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +add_subdirectory(spffl) +#add_subdirectory(lib) +#add_subdirectory(cli) + +enable_testing() +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/") +add_subdirectory(test) + +# ---------------------------------------------------------------- +#install( +# DIRECTORY "spffl/" # The trailing slash is important so "spffl" isn't a part of the install path +# DESTINATION "include/spffl" +# FILES_MATCHING PATTERN "*.h" +#) +#install(TARGETS spffl DESTINATION lib) +#install(TARGETS spiff DESTINATION bin) diff --git a/spffl20/CMakeLists.txt b/cpp20/spffl/CMakeLists.txt similarity index 100% rename from spffl20/CMakeLists.txt rename to cpp20/spffl/CMakeLists.txt diff --git a/spffl20/README.md b/cpp20/spffl/README.md similarity index 100% rename from spffl20/README.md rename to cpp20/spffl/README.md diff --git a/spffl20/mod/CMakeLists.txt b/cpp20/spffl/mod/CMakeLists.txt similarity index 100% rename from spffl20/mod/CMakeLists.txt rename to cpp20/spffl/mod/CMakeLists.txt diff --git a/spffl20/mod/foo.cpp b/cpp20/spffl/mod/foo.cpp similarity index 100% rename from spffl20/mod/foo.cpp rename to cpp20/spffl/mod/foo.cpp diff --git a/spffl20/mod/foo.h b/cpp20/spffl/mod/foo.h similarity index 100% rename from spffl20/mod/foo.h rename to cpp20/spffl/mod/foo.h diff --git a/test20/CMakeLists.txt b/cpp20/test/CMakeLists.txt similarity index 100% rename from test20/CMakeLists.txt rename to cpp20/test/CMakeLists.txt diff --git a/cpp20/test/README.md b/cpp20/test/README.md new file mode 100644 index 0000000..26504e2 --- /dev/null +++ b/cpp20/test/README.md @@ -0,0 +1 @@ +This is Catch2 for `cpp20/spffl`. diff --git a/test20/mod/CMakeLists.txt b/cpp20/test/mod/CMakeLists.txt similarity index 98% rename from test20/mod/CMakeLists.txt rename to cpp20/test/mod/CMakeLists.txt index cbfeff4..d93c848 100644 --- a/test20/mod/CMakeLists.txt +++ b/cpp20/test/mod/CMakeLists.txt @@ -1,4 +1,4 @@ -project(test_base) +project(test_mod) # ---------------------------------------------------------------- # catch2 has a set-but-unused-variable warning as of MacOS 13.3. diff --git a/cpp20/test/mod/test_mod.cpp b/cpp20/test/mod/test_mod.cpp new file mode 100644 index 0000000..fa51d33 --- /dev/null +++ b/cpp20/test/mod/test_mod.cpp @@ -0,0 +1,7 @@ +#include + +#include "spffl/mod/foo.h" + +TEST_CASE("spffl::mod::foo") { + CHECK(foo(2,3) == 5); +} diff --git a/test20/README.md b/test20/README.md deleted file mode 100644 index f9903b6..0000000 --- a/test20/README.md +++ /dev/null @@ -1 +0,0 @@ -This is Catch2 for `../spffl20`. diff --git a/test20/mod/test_mod.cpp b/test20/mod/test_mod.cpp deleted file mode 100644 index 29033f7..0000000 --- a/test20/mod/test_mod.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include - -#include "spffl20/foo/foo.h" - -TEST_CASE("spffl20::mod::foo") { - CHECK(1 == 0); -}