Commit b9a2f320b912aae623c4acddea06cba399b98654

Authored by Philip Top
Committed by GitHub
1 parent 7432ab26

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
README.md
... ... @@ -151,6 +151,21 @@ make
151 151 GTEST_COLOR=1 CTEST_OUTPUT_ON_FAILURE=1 make test
152 152 ```
153 153  
  154 +<details><summary>Note: Special instructions for GCC 8</summary><p>
  155 +
  156 +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.
  157 +
  158 +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.
  159 +
  160 +There may also be other cases where a specific library needs to be linked.
  161 +
  162 +Defining `CLI11_HAS_FILESYSTEM=0` which will remove the usage and hence any linking issue.
  163 +
  164 +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.
  165 +
  166 +</p></details>
  167 +</br>
  168 +
154 169 ## Usage
155 170  
156 171 ### Adding options
... ...
azure-pipelines.yml
... ... @@ -6,6 +6,9 @@
6 6 trigger:
7 7 - master
8 8  
  9 +pr:
  10 +- master
  11 +
9 12 variables:
10 13 cli11.single: ON
11 14 cli11.std: 14
... ... @@ -57,6 +60,9 @@ jobs:
57 60 Windows11:
58 61 vmImage: 'vs2017-win2016'
59 62 cli11.std: 11
  63 + Windowslatest:
  64 + vmImage: 'windows-2019'
  65 + cli11.std: 17
60 66 pool:
61 67 vmImage: $(vmImage)
62 68 steps:
... ... @@ -89,6 +95,9 @@ jobs:
89 95 gcc9:
90 96 containerImage: gcc:9
91 97 cli11.std: 17
  98 + gcc8:
  99 + containerImage: gcc:8
  100 + cli11.std: 17
92 101 gcc4.8:
93 102 containerImage: gcc:4.8
94 103 cli11.std: 11
... ... @@ -100,6 +109,10 @@ jobs:
100 109 containerImage: silkeh/clang:8
101 110 cli11.std: 14
102 111 cli11.options: -DCLI11_FORCE_LIBCXX=ON
  112 + clang8_17:
  113 + containerImage: silkeh/clang:8
  114 + cli11.std: 17
  115 + cli11.options: -DCLI11_FORCE_LIBCXX=ON
103 116 container: $[ variables['containerImage'] ]
104 117 steps:
105 118 - template: .ci/azure-cmake.yml
... ...
include/CLI/FormatterFwd.hpp
... ... @@ -24,9 +24,9 @@ class App;
24 24 /// the second argument.
25 25  
26 26 enum class AppFormatMode {
27   - Normal, //< The normal, detailed help
28   - All, //< A fully expanded help
29   - Sub, //< Used when printed as part of expanded subcommand
  27 + Normal, ///< The normal, detailed help
  28 + All, ///< A fully expanded help
  29 + Sub, ///< Used when printed as part of expanded subcommand
30 30 };
31 31  
32 32 /// This is the minimum requirements to run a formatter.
... ...
include/CLI/Validators.hpp
... ... @@ -33,7 +33,14 @@
33 33 #else
34 34 #include <filesystem>
35 35 #if defined __cpp_lib_filesystem && __cpp_lib_filesystem >= 201703
  36 +#if defined _GLIBCXX_RELEASE && _GLIBCXX_RELEASE >= 9
36 37 #define CLI11_HAS_FILESYSTEM 1
  38 +#elif defined(__GLIBCXX__)
  39 +// if we are using gcc and Version <9 default to no filesystem
  40 +#define CLI11_HAS_FILESYSTEM 0
  41 +#else
  42 +#define CLI11_HAS_FILESYSTEM 1
  43 +#endif
37 44 #else
38 45 #define CLI11_HAS_FILESYSTEM 0
39 46 #endif
... ...