1
0
mirror of https://github.com/CLIUtils/CLI11.git synced 2025-05-01 05:03:52 +00:00

Add windows latest and gcc 8 builds to azure (#446)

* add windows latest and gcc 8 builds to azure

* try adding pr trigger

* try adding something specific for gcc 8

* use interface instead of public

* try C++17 on clang 8

* update the readme with some additional notes about gcc 8

* fix some incorrect doxygen comment formatting

* try using the glibcxx_release value

* debug some code paths to make sure macros are working

* Update readme and fix formatting.

* update formatting for Validators
This commit is contained in:
Philip Top 2020-04-01 22:55:20 -07:00 committed by GitHub
parent 7432ab264d
commit b9a2f320b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 38 additions and 3 deletions

View File

@ -151,6 +151,21 @@ make
GTEST_COLOR=1 CTEST_OUTPUT_ON_FAILURE=1 make test GTEST_COLOR=1 CTEST_OUTPUT_ON_FAILURE=1 make test
``` ```
<details><summary>Note: Special instructions for GCC 8</summary><p>
If you are using GCC 8 and using it in C++17 mode with CLI11. CLI11 makes use of the `<filesystem>` 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 `<filesystem>` 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.
</p></details>
</br>
## Usage ## Usage
### Adding options ### Adding options

View File

@ -6,6 +6,9 @@
trigger: trigger:
- master - master
pr:
- master
variables: variables:
cli11.single: ON cli11.single: ON
cli11.std: 14 cli11.std: 14
@ -57,6 +60,9 @@ jobs:
Windows11: Windows11:
vmImage: 'vs2017-win2016' vmImage: 'vs2017-win2016'
cli11.std: 11 cli11.std: 11
Windowslatest:
vmImage: 'windows-2019'
cli11.std: 17
pool: pool:
vmImage: $(vmImage) vmImage: $(vmImage)
steps: steps:
@ -89,6 +95,9 @@ jobs:
gcc9: gcc9:
containerImage: gcc:9 containerImage: gcc:9
cli11.std: 17 cli11.std: 17
gcc8:
containerImage: gcc:8
cli11.std: 17
gcc4.8: gcc4.8:
containerImage: gcc:4.8 containerImage: gcc:4.8
cli11.std: 11 cli11.std: 11
@ -100,6 +109,10 @@ jobs:
containerImage: silkeh/clang:8 containerImage: silkeh/clang:8
cli11.std: 14 cli11.std: 14
cli11.options: -DCLI11_FORCE_LIBCXX=ON cli11.options: -DCLI11_FORCE_LIBCXX=ON
clang8_17:
containerImage: silkeh/clang:8
cli11.std: 17
cli11.options: -DCLI11_FORCE_LIBCXX=ON
container: $[ variables['containerImage'] ] container: $[ variables['containerImage'] ]
steps: steps:
- template: .ci/azure-cmake.yml - template: .ci/azure-cmake.yml

View File

@ -24,9 +24,9 @@ class App;
/// the second argument. /// the second argument.
enum class AppFormatMode { enum class AppFormatMode {
Normal, //< The normal, detailed help Normal, ///< The normal, detailed help
All, //< A fully expanded help All, ///< A fully expanded help
Sub, //< Used when printed as part of expanded subcommand Sub, ///< Used when printed as part of expanded subcommand
}; };
/// This is the minimum requirements to run a formatter. /// This is the minimum requirements to run a formatter.

View File

@ -33,7 +33,14 @@
#else #else
#include <filesystem> #include <filesystem>
#if defined __cpp_lib_filesystem && __cpp_lib_filesystem >= 201703 #if defined __cpp_lib_filesystem && __cpp_lib_filesystem >= 201703
#if defined _GLIBCXX_RELEASE && _GLIBCXX_RELEASE >= 9
#define CLI11_HAS_FILESYSTEM 1 #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 #else
#define CLI11_HAS_FILESYSTEM 0 #define CLI11_HAS_FILESYSTEM 0
#endif #endif