Skip to content

Commit

Permalink
Cmake issue with msvc
Browse files Browse the repository at this point in the history
  • Loading branch information
jgaa committed Aug 16, 2024
1 parent ff225c1 commit 0689b5d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
strategy:
matrix:
include:
- os: ubuntu-latest
compiler: gcc
- os: ubuntu-latest
compiler: clang
# - os: ubuntu-latest
# compiler: gcc
# - os: ubuntu-latest
# compiler: clang
- os: windows-latest
compiler: msvc
# - os: macos-latest
Expand Down
11 changes: 9 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,15 @@ message(STATUS "Building restc-cpp version ${PROJECT_VERSION}")

include(CheckCXXCompilerFlag)

check_cxx_compiler_flag("-std=c++20" COMPILER_SUPPORTS_CXX20)
check_cxx_compiler_flag("-std=c++17" COMPILER_SUPPORTS_CXX17)
if (MSVC)
# Thank you Microsoft. Its so nice of you to give us all these meaningful reasons to stay up all night.
check_cxx_compiler_flag("/std:c++20" COMPILER_SUPPORTS_CXX20)
check_cxx_compiler_flag("/std:c++17" COMPILER_SUPPORTS_CXX17)
else()
check_cxx_compiler_flag("-std=c++20" COMPILER_SUPPORTS_CXX20)
check_cxx_compiler_flag("-std=c++17" COMPILER_SUPPORTS_CXX17)
endif()



if (NOT DEFINED INSTALL_RAPIDJSON_HEADERS)
Expand Down

0 comments on commit 0689b5d

Please sign in to comment.