Skip to content

Commit

Permalink
Fix __cplusplus macro for Visual Studio (#237)
Browse files Browse the repository at this point in the history
* Fix __cplusplus macro for Visual Studio

* Upgrade GTest

* Force rebuild of GTest to build with C++17 onwards support

* Reinstate cmake layout

* Test if fetched gtest correctly builds for C++17

* Manually build Gtest to work around fetching the wrong build from the Conan Index Centre

* Attemp to use pre-built GTest if available

* Test fix is backward compatible with prior versions

* Revert to latest version

* Force building GTest on Windows is still required
  • Loading branch information
Twon authored Apr 12, 2024
1 parent 278d575 commit 5c87840
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions cmake/compiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ target_link_libraries(MorpheusConfig

target_compile_options(MorpheusConfig
INTERFACE
$<$<CXX_COMPILER_ID:MSVC>:/Zc:__cplusplus> # https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/
$<$<CXX_COMPILER_ID:MSVC>:${MSVC_WARNINGS}>
$<$<CXX_COMPILER_ID:GNU>:${GCC_WARNINGS}>
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:${CLANG_WARNINGS}>
Expand Down

0 comments on commit 5c87840

Please sign in to comment.