From b28dfcd1150b3a13b2a2cbf467f02c379fb42f03 Mon Sep 17 00:00:00 2001 From: "Dr. Colin Hirsch" Date: Fri, 7 Jul 2023 22:21:02 +0200 Subject: [PATCH 1/4] Merge pull request #350 from baconpaul/cmake-347 Add a CMake option to select no std::filesystem --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c2ee336f3..c06f9a681 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,6 +50,7 @@ target_include_directories(pegtl INTERFACE target_compile_features(pegtl INTERFACE cxx_std_17) option(PEGTL_USE_BOOST_FILESYSTEM "Override the auto-detection of std::filesystem and use Boost.Filesystem" OFF) +option(PEGTL_USE_FILESYSTEM "Use available implementation of std::filesystem (std::, std::experiemntal, or Boost)" ON) # Try compiling a test program with std::filesystem or one of its alternatives function(check_filesystem_impl FILESYSTEM_HEADER FILESYSTEM_NAMESPACE OPTIONAL_LIBS OUT_RESULT) @@ -82,7 +83,10 @@ function(check_filesystem_impl FILESYSTEM_HEADER FILESYSTEM_NAMESPACE OPTIONAL_L set(${OUT_RESULT} ${TEST_RESULT} PARENT_SCOPE) endfunction() -if(PEGTL_USE_BOOST_FILESYSTEM) +if (NOT PEGTL_USE_FILESYSTEM) + target_compile_definitions(${PROJECT_NAME} INTERFACE TAO_PEGTL_NO_FILESYSTEM) + message(STATUS "Skipping std::filesystem (or variant) in PEGTL; File operations will not work or compile.") +elseif (PEGTL_USE_BOOST_FILESYSTEM) # Force the use of Boost.Filesystem: #include // boost::filesystem find_package(Boost REQUIRED COMPONENTS filesystem) target_link_libraries(${PROJECT_NAME} INTERFACE Boost::filesystem) From 4cc5e83436f74d2c240568ae99197144ab0e867f Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Mon, 10 Jul 2023 11:16:03 +0200 Subject: [PATCH 2/4] validate no filesystem support Signed-off-by: Uilian Ries --- .github/workflows/no-filesystem.yml | 38 +++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/no-filesystem.yml diff --git a/.github/workflows/no-filesystem.yml b/.github/workflows/no-filesystem.yml new file mode 100644 index 000000000..ff0823de7 --- /dev/null +++ b/.github/workflows/no-filesystem.yml @@ -0,0 +1,38 @@ +name: No-Filesystem + +on: + push: + paths-ignore: + - 'README.md' + - 'doc/**' + pull_request: + paths-ignore: + - 'README.md' + - 'doc/**' + +jobs: + no-exceptions: + strategy: + fail-fast: false + matrix: + compiler: [g++, clang++] + build_type: [Release] + + runs-on: ubuntu-latest + + env: + CXX: ${{ matrix.compiler }} + + steps: + - uses: actions/checkout@v2 + + - run: cmake -E make_directory build + + - working-directory: build/ + run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DPEGTL_USE_FILESYSTEM=OFF -DPEGTL_USE_BOOST_FILESYSTEM=OFF + + - working-directory: build/ + run: cmake --build . + + - working-directory: build/ + run: ctest --output-on-failure From 91ca84cabeccc6c0d28663cdcacb43f2e64124d5 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Mon, 10 Jul 2023 11:28:56 +0200 Subject: [PATCH 3/4] use specific versions of Ubuntu Signed-off-by: Uilian Ries --- .github/workflows/linux.yml | 6 +++--- .github/workflows/no-filesystem.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index e9ace6480..a1c8be675 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -23,7 +23,7 @@ jobs: - clang++-12 build_type: [Debug, Release] - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 env: CXX: ${{ matrix.compiler }} @@ -84,7 +84,7 @@ jobs: - clang++-9 build_type: [Debug, Release] - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 env: CXX: ${{ matrix.compiler }} @@ -137,7 +137,7 @@ jobs: flags: ["-fno-rtti", "-fms-extensions"] build_type: [Debug, Release] - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 env: CXX: clang++ diff --git a/.github/workflows/no-filesystem.yml b/.github/workflows/no-filesystem.yml index ff0823de7..4fe821845 100644 --- a/.github/workflows/no-filesystem.yml +++ b/.github/workflows/no-filesystem.yml @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: false matrix: - compiler: [g++, clang++] + compiler: [g++] build_type: [Release] runs-on: ubuntu-latest From 86a677aeab71647b63e3fbb93b8953cad2fa3c38 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Mon, 10 Jul 2023 11:42:01 +0200 Subject: [PATCH 4/4] Use MacOS 13 and 14 to build tests Signed-off-by: Uilian Ries --- .github/workflows/macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 646fc5a0c..ecdb3164f 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: false matrix: - xcode: ['11', '12', '13'] + xcode: ['13', '14'] build_type: [Debug, Release] runs-on: macos-latest