Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .buckconfig
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
gh_facebook_buck2_shims_meta = shim

[cxx]
cxxflags = -g -std=c++17
cxxflags = -g -std=c++20

[parser]
target_platform_detector_spec = target:root//...->prelude//platforms:default target:shim//...->prelude//platforms:default
Expand Down
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ include(ExternalProject)
include(GNUInstallDirs)

if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD 20)
endif()
announce_configured_options(CMAKE_CXX_STANDARD)

Expand Down Expand Up @@ -233,6 +233,8 @@ endif()
# they can be properly gc'd. -s: strip symbol.
if(WIN32)
set(CMAKE_CXX_FLAGS_RELEASE "/Gy /Gw ${CMAKE_CXX_FLAGS_RELEASE}")
# C++20 headers pull in <windows.h>; suppress its min/max macros.
add_compile_definitions(NOMINMAX)
else()
set(CMAKE_CXX_FLAGS_RELEASE
"-ffunction-sections -fdata-sections ${CMAKE_CXX_FLAGS_RELEASE}"
Expand Down
3 changes: 3 additions & 0 deletions backends/arm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ project(arm_backend)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

# Pin to C++17 for embedded toolchain compatibility (not all support C++20).
set(CMAKE_CXX_STANDARD 17)

# Source root directory for executorch.
if(NOT EXECUTORCH_ROOT)
set(EXECUTORCH_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../..)
Expand Down
5 changes: 2 additions & 3 deletions backends/cadence/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
# Set the minimum required version of CMake for this project.
cmake_minimum_required(VERSION 3.10)

if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
endif()
# Pin to C++17 for embedded toolchain compatibility (not all support C++20).
set(CMAKE_CXX_STANDARD 17)

# Set the project name.
project(cadence_backend)
Expand Down
5 changes: 2 additions & 3 deletions backends/cadence/fusion_g3/operators/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
cmake_minimum_required(VERSION 3.19)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
endif()
# Pin to C++17 for embedded toolchain compatibility (not all support C++20).
set(CMAKE_CXX_STANDARD 17)

include(${EXECUTORCH_ROOT}/tools/cmake/Utils.cmake)
include(${EXECUTORCH_ROOT}/tools/cmake/Codegen.cmake)
Expand Down
5 changes: 2 additions & 3 deletions backends/cadence/generic/operators/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
cmake_minimum_required(VERSION 3.19)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
endif()
# Pin to C++17 for embedded toolchain compatibility (not all support C++20).
set(CMAKE_CXX_STANDARD 17)

include(${EXECUTORCH_ROOT}/tools/cmake/Utils.cmake)
include(${EXECUTORCH_ROOT}/tools/cmake/Codegen.cmake)
Expand Down
5 changes: 2 additions & 3 deletions backends/cadence/hifi/operators/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
cmake_minimum_required(VERSION 3.19)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
endif()
# Pin to C++17 for embedded toolchain compatibility (not all support C++20).
set(CMAKE_CXX_STANDARD 17)

include(${EXECUTORCH_ROOT}/tools/cmake/Utils.cmake)
include(${EXECUTORCH_ROOT}/tools/cmake/Codegen.cmake)
Expand Down
5 changes: 2 additions & 3 deletions backends/cadence/vision/operators/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
cmake_minimum_required(VERSION 3.19)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
endif()
# Pin to C++17 for embedded toolchain compatibility (not all support C++20).
set(CMAKE_CXX_STANDARD 17)

include(${EXECUTORCH_ROOT}/tools/cmake/Utils.cmake)
include(${EXECUTORCH_ROOT}/tools/cmake/Codegen.cmake)
Expand Down
5 changes: 2 additions & 3 deletions backends/cortex_m/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
cmake_minimum_required(VERSION 3.19)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
endif()
# Pin to C++17 for embedded toolchain compatibility (not all support C++20).
set(CMAKE_CXX_STANDARD 17)

# Source root directory for executorch
if(NOT EXECUTORCH_ROOT)
Expand Down
3 changes: 3 additions & 0 deletions backends/mediatek/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
*/
]]

# Pin to C++17 for embedded toolchain compatibility (not all support C++20).
set(CMAKE_CXX_STANDARD 17)

# Let include directory as "executorch/..."
set(_common_include_directories ${CMAKE_CURRENT_SOURCE_DIR}/../../..)

Expand Down
3 changes: 3 additions & 0 deletions backends/nxp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

# Pin to C++17 for embedded toolchain compatibility (not all support C++20).
set(CMAKE_CXX_STANDARD 17)

set(_common_include_directories ${CMAKE_CURRENT_SOURCE_DIR}/../../..)
add_compile_definitions(C10_USING_CUSTOM_GENERATED_MACROS)

Expand Down
Loading