From 0ad03de428feb68bdd24ea70bf3ceeff36f6316e Mon Sep 17 00:00:00 2001 From: Sean Robinson Date: Thu, 4 Aug 2022 11:35:37 -0700 Subject: [PATCH 1/5] Reenable Windows 2019 MSVC runner windows-latest changed to Windows 2022 during first quarter of 2022. This adds windows-2019 to CI test matrix do that we can catch changes that break the older configuration. Signed-off-by: Sean Robinson --- .github/workflows/ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 32379e8..eb4d38f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,7 @@ jobs: - macos-latest-clang - ubuntu-latest-clang - ubuntu-latest-gcc + - windows-2019-msvc - windows-latest-msvc include: @@ -36,6 +37,11 @@ jobs: c_compiler: cc cxx_compiler: g++ + - toolchain: windows-2019-msvc + os: windows-2019 + c_compiler: msvc + cxx_compiler: msvc + - toolchain: windows-latest-msvc os: windows-latest c_compiler: msvc From 566d1df20e440707bd3ba286e147d3d7c014d643 Mon Sep 17 00:00:00 2001 From: Sean Robinson Date: Thu, 4 Aug 2022 11:37:02 -0700 Subject: [PATCH 2/5] Add MacOS 12 CI runner This expands test environment coverage to two MacOS versions. Signed-off-by: Sean Robinson --- .github/workflows/ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eb4d38f..bdc224f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,6 +16,7 @@ jobs: toolchain: - macos-latest-clang + - macos-12-clang - ubuntu-latest-clang - ubuntu-latest-gcc - windows-2019-msvc @@ -27,6 +28,11 @@ jobs: c_compiler: clang cxx_compiler: clang++ + - toolchain: macos-12-clang + os: macos-latest + c_compiler: clang + cxx_compiler: clang++ + - toolchain: ubuntu-latest-clang os: ubuntu-latest c_compiler: clang From 8a90914a2add81049435094a4c23d6ed03d4d59e Mon Sep 17 00:00:00 2001 From: Sean Robinson Date: Thu, 11 Aug 2022 12:00:31 -0700 Subject: [PATCH 3/5] Add Windows 2022 Clang-cl runner Several people using clang-cl on Windows are reporting build errors after a upgrading to v13. This tries to replicate the error to allow testing a fix. Signed-off-by: Sean Robinson --- .github/workflows/ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bdc224f..ad1aa60 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,6 +21,7 @@ jobs: - ubuntu-latest-gcc - windows-2019-msvc - windows-latest-msvc + - windows-latest-clang include: - toolchain: macos-latest-clang @@ -53,6 +54,11 @@ jobs: c_compiler: msvc cxx_compiler: msvc + - toolchain: windows-latest-clang + os: windows-latest + c_compiler: clang-cl + cxx_compiler: clang-cl + steps: - name: Checkout Code From d8c10a9c790dedbecb1ff82240e3a3a8a8b0ae63 Mon Sep 17 00:00:00 2001 From: Sean Robinson Date: Thu, 11 Aug 2022 13:20:43 -0700 Subject: [PATCH 4/5] Add cmake_opts value to allow specifying an alternate toolchain The new "windows-latest-clang" target does not honor the CXX environment variable and uses the default MSVC compiler. This tries to tell cmake to handle things via a toolset name. Signed-off-by: Sean Robinson --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ad1aa60..4324179 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,6 +58,7 @@ jobs: os: windows-latest c_compiler: clang-cl cxx_compiler: clang-cl + cmake_opts: -T ClangCL steps: @@ -66,7 +67,7 @@ jobs: - name: Configure working-directory: test - run: cmake -S . -B build + run: cmake -S . -B build ${{ matrix.cmake_opts }} env: CC: ${{ matrix.c_compiler }} CXX: ${{ matrix.cxx_compiler }} From a8e2823d687dc2c7e1f771ad3c310c619e77ccae Mon Sep 17 00:00:00 2001 From: Sean Robinson Date: Thu, 11 Aug 2022 13:35:14 -0700 Subject: [PATCH 5/5] Replace constexpr generic_strtod with inline const clang-ci >= 13.0 is failing to compile a constexpr function pointer assignment. This is possibly due to strtof (and family) not being implemented as constexpr in the relevant libc++. Closes #136 Closes #156 Signed-off-by: Sean Robinson --- include/argparse/argparse.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/argparse/argparse.hpp b/include/argparse/argparse.hpp index 569704e..b88ac63 100644 --- a/include/argparse/argparse.hpp +++ b/include/argparse/argparse.hpp @@ -246,10 +246,10 @@ template struct parse_number { namespace { -template constexpr auto generic_strtod = nullptr; -template <> constexpr auto generic_strtod = strtof; -template <> constexpr auto generic_strtod = strtod; -template <> constexpr auto generic_strtod = strtold; +template inline const auto generic_strtod = nullptr; +template <> inline const auto generic_strtod = strtof; +template <> inline const auto generic_strtod = strtod; +template <> inline const auto generic_strtod = strtold; } // namespace