diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index aac7aae..516db7e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -27,30 +27,3 @@ jobs: run: cmake --build build - name: Run tests run: ctest --output-on-failure --test-dir build - - test-modules: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: - - ubuntu-24.04 - - windows-2022 - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - name: Configure CMake (LLVM Clang) - if: ${{ matrix.os == 'ubuntu-24.04' }} - run: | - sudo apt install ninja-build - cmake -B build \ - -DTMP_USE_MODULES:BOOL=ON \ - -DCMAKE_CXX_COMPILER=clang++-17 \ - -G Ninja - - name: Configure CMake (MSVC) - if: ${{ matrix.os == 'windows-2022' }} - run: cmake -B build -DTMP_USE_MODULES:BOOL=ON - - name: Build tests - run: cmake --build build - - name: Run tests - run: ctest --output-on-failure --test-dir build diff --git a/CMakeLists.txt b/CMakeLists.txt index 236b7d0..80b66c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,11 +1,6 @@ cmake_minimum_required(VERSION 3.14) project(tmp VERSION 0.9) -option(TMP_USE_MODULES "Build C++20 modules" OFF) -if(TMP_USE_MODULES) - cmake_minimum_required(VERSION 3.28) -endif() - list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/") include(GNUInstallDirs) @@ -14,15 +9,6 @@ find_package(Filesystem REQUIRED) add_library(${PROJECT_NAME} STATIC src/tmp.cpp) target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17) -if(TMP_USE_MODULES) - target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_20) - target_sources( - ${PROJECT_NAME} - PUBLIC FILE_SET CXX_MODULES - FILES src/tmp.cppm - BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/src) -endif() - target_link_libraries(${PROJECT_NAME} PUBLIC std::filesystem) set_target_properties(${PROJECT_NAME} PROPERTIES EXPORT_NAME tmp) target_include_directories( @@ -61,9 +47,7 @@ if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) install( TARGETS ${PROJECT_NAME} - EXPORT tmp-targets - FILE_SET CXX_MODULES - DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}) + EXPORT tmp-targets) install( EXPORT tmp-targets FILE tmp-targets.cmake diff --git a/src/tmp.cppm b/src/tmp.cppm deleted file mode 100644 index dfcdfed..0000000 --- a/src/tmp.cppm +++ /dev/null @@ -1,14 +0,0 @@ -module; - -#include -#include -#include - -export module tmp; - -export namespace tmp { - -using tmp::directory; -using tmp::entry; -using tmp::file; -} // namespace tmp diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 05070b2..7a709c5 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -5,9 +5,7 @@ find_package(GTest) add_executable(${PROJECT_NAME} directory.cpp file.cpp) target_link_libraries(${PROJECT_NAME} tmp::tmp GTest::gtest_main) target_compile_definitions( - ${PROJECT_NAME} - PRIVATE PREFIX="com.github.bugdea1er.tmp" - $<$:TMP_USE_MODULES>) + ${PROJECT_NAME} PRIVATE PREFIX="com.github.bugdea1er.tmp") include(GoogleTest) gtest_discover_tests(${PROJECT_NAME} EXTRA_ARGS --gtest_color=yes) diff --git a/tests/directory.cpp b/tests/directory.cpp index 3da3dc5..7b191e6 100644 --- a/tests/directory.cpp +++ b/tests/directory.cpp @@ -1,9 +1,5 @@ -#ifdef TMP_USE_MODULES -import tmp; -#else #include #include -#endif #include diff --git a/tests/file.cpp b/tests/file.cpp index 5e0e63c..9ed824e 100644 --- a/tests/file.cpp +++ b/tests/file.cpp @@ -1,9 +1,5 @@ -#ifdef TMP_USE_MODULES -import tmp; -#else #include #include -#endif #include