# HG changeset patch # User Sebastien Jodogne # Date 1743783721 -7200 # Node ID a2834b7f4027e751ddeae3eedf55b61b51759b1d # Parent 4a03333b69f6f1e1cbb5c57b704acf90e8f1996b setting CMAKE_CXX_STANDARD to 11 for macOS diff -r 4a03333b69f6 -r a2834b7f4027 OrthancFramework/Resources/CMake/Compiler.cmake --- a/OrthancFramework/Resources/CMake/Compiler.cmake Fri Apr 04 16:52:21 2025 +0200 +++ b/OrthancFramework/Resources/CMake/Compiler.cmake Fri Apr 04 18:22:01 2025 +0200 @@ -22,6 +22,16 @@ # This file sets all the compiler-related flags +if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") + # Since Orthanc 1.12.7 that allows CMake 4.0, builds for macOS + # require the C++ standard to be explicitly set to C++11. Do *not* + # do this on GNU/Linux, as third-party system libraries could have + # been compiled with higher versions of the C++ standard. + set(CMAKE_CXX_STANDARD 11) + set(CMAKE_CXX_STANDARD_REQUIRED ON) + set(CMAKE_CXX_EXTENSIONS OFF) +endif() + # Save the current compiler flags to the cache every time cmake configures the project set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "compiler flags" FORCE)