Skip to content

Commit

Permalink
Enabling c++ 20 in MacOS build (#16187)
Browse files Browse the repository at this point in the history
### Description
<!-- Describe your changes. -->



### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
  • Loading branch information
jchen351 committed Sep 26, 2023
1 parent b8e3481 commit 0141e27
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 87 deletions.
5 changes: 5 additions & 0 deletions cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ include(CMakeDependentOption)
include(FetchContent)
include(CheckFunctionExists)

# TODO: update this once all system adapt c++20
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(CMAKE_CXX_STANDARD 20)
else()
set(CMAKE_CXX_STANDARD 17)
endif()

set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# NOTE: POSITION INDEPENDENT CODE hurts performance, and it only make sense on POSIX systems
Expand Down
4 changes: 2 additions & 2 deletions cmake/onnxruntime_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@
#cmakedefine HAS_UNUSED_BUT_SET_VARIABLE
#cmakedefine HAS_UNUSED_VARIABLE
#cmakedefine HAS_USELESS_CAST
#cmakedefine ORT_BUILD_INFO u8"@ORT_BUILD_INFO@"
#cmakedefine ORT_VERSION u8"@ORT_VERSION@"
#cmakedefine ORT_BUILD_INFO "@ORT_BUILD_INFO@"
#cmakedefine ORT_VERSION "@ORT_VERSION@"
Loading

0 comments on commit 0141e27

Please sign in to comment.