diff --git a/README.md b/README.md index 99fe9636..82e9c1a1 100644 --- a/README.md +++ b/README.md @@ -151,6 +151,21 @@ make GTEST_COLOR=1 CTEST_OUTPUT_ON_FAILURE=1 make test ``` +
Note: Special instructions for GCC 8

+ +If you are using GCC 8 and using it in C++17 mode with CLI11. CLI11 makes use of the `` header if available, but specifically for this compiler, the `filesystem` library is separate from the standard library and needs to be linked separately. So it is available but CLI11 doesn't use it by default. + +Specifically `libstdc++fs` needs to be added to the linking list and `CLI11_HAS_FILESYSTEM=1` has to be defined. Then the filesystem variant of the Validators could be used on GCC 8. GCC 9+ does not have this issue so the `` is used by default. + +There may also be other cases where a specific library needs to be linked. + +Defining `CLI11_HAS_FILESYSTEM=0` which will remove the usage and hence any linking issue. + +In some cases certain clang compilations may require linking against `libc++fs`. These situations have not been encountered so the specific situations requiring them are unknown yet. + +

+
+ ## Usage ### Adding options diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d01a2406..23386cd4 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -6,6 +6,9 @@ trigger: - master +pr: +- master + variables: cli11.single: ON cli11.std: 14 @@ -57,6 +60,9 @@ jobs: Windows11: vmImage: 'vs2017-win2016' cli11.std: 11 + Windowslatest: + vmImage: 'windows-2019' + cli11.std: 17 pool: vmImage: $(vmImage) steps: @@ -89,6 +95,9 @@ jobs: gcc9: containerImage: gcc:9 cli11.std: 17 + gcc8: + containerImage: gcc:8 + cli11.std: 17 gcc4.8: containerImage: gcc:4.8 cli11.std: 11 @@ -100,6 +109,10 @@ jobs: containerImage: silkeh/clang:8 cli11.std: 14 cli11.options: -DCLI11_FORCE_LIBCXX=ON + clang8_17: + containerImage: silkeh/clang:8 + cli11.std: 17 + cli11.options: -DCLI11_FORCE_LIBCXX=ON container: $[ variables['containerImage'] ] steps: - template: .ci/azure-cmake.yml diff --git a/include/CLI/FormatterFwd.hpp b/include/CLI/FormatterFwd.hpp index a98a05f0..4c4a5de0 100644 --- a/include/CLI/FormatterFwd.hpp +++ b/include/CLI/FormatterFwd.hpp @@ -24,9 +24,9 @@ class App; /// the second argument. enum class AppFormatMode { - Normal, //< The normal, detailed help - All, //< A fully expanded help - Sub, //< Used when printed as part of expanded subcommand + Normal, ///< The normal, detailed help + All, ///< A fully expanded help + Sub, ///< Used when printed as part of expanded subcommand }; /// This is the minimum requirements to run a formatter. diff --git a/include/CLI/Validators.hpp b/include/CLI/Validators.hpp index 07da72a3..9f47477d 100644 --- a/include/CLI/Validators.hpp +++ b/include/CLI/Validators.hpp @@ -33,7 +33,14 @@ #else #include #if defined __cpp_lib_filesystem && __cpp_lib_filesystem >= 201703 +#if defined _GLIBCXX_RELEASE && _GLIBCXX_RELEASE >= 9 #define CLI11_HAS_FILESYSTEM 1 +#elif defined(__GLIBCXX__) +// if we are using gcc and Version <9 default to no filesystem +#define CLI11_HAS_FILESYSTEM 0 +#else +#define CLI11_HAS_FILESYSTEM 1 +#endif #else #define CLI11_HAS_FILESYSTEM 0 #endif