From 53a8842abb3df5877b1b2c6ccf935561282ced68 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Tue, 10 Jan 2023 09:44:00 -0800 Subject: [PATCH] Set C++ version consistently to C++ 14 (#1203) Summary: Pull Request resolved: https://github.com/facebook/yoga/pull/1203 ~~This sets the C++ standard to C++ 17 in the working builds and Apple. GTest will stop supporting C++ 11 soon, so we need to update. C++ 14 is more embeddable, but C++ 17 support and usage should be relatively common now and the language version adds quite a bit.~~ This bumps from C++ 11 to C++ 14 in existing places where it is specified. C++ 17 allows more, and is better aligned to infra (semantics can change in std versions in suprising ways), but C++ 14 still has broader ecosystem compatibility. Changelog: [Internal] Reviewed By: cortinico, dmytrorykun Differential Revision: D42285391 fbshipit-source-id: 88d7b6b8783a80b9b2e48781a2fd3d326ecd87d0 --- CMakeLists.txt | 4 ++-- Yoga.podspec | 2 +- java/CMakeLists.txt | 2 +- javascript/CMakeLists.txt | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f357c83d..421baf96 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,7 @@ add_compile_options( -ffunction-sections -fdata-sections -Wall - -std=c++11) + -std=c++14) file(GLOB_RECURSE yogacore_SRC yoga/*.cpp) add_library(yogacore STATIC ${yogacore_SRC}) @@ -28,7 +28,7 @@ if (ANDROID) target_link_libraries(yogacore android log) endif() -set_target_properties(yogacore PROPERTIES CXX_STANDARD 11) +set_target_properties(yogacore PROPERTIES CXX_STANDARD 14) # cmake install config include(GNUInstallDirs) diff --git a/Yoga.podspec b/Yoga.podspec index 077f6ccd..bbe0aabe 100644 --- a/Yoga.podspec +++ b/Yoga.podspec @@ -30,7 +30,7 @@ Pod::Spec.new do |spec| '-fexceptions', '-Wall', '-Werror', - '-std=c++1y', + '-std=c++14', '-fPIC' ] spec.source_files = 'yoga/**/*.{c,h,cpp}' diff --git a/java/CMakeLists.txt b/java/CMakeLists.txt index 50b08cb9..f2ffa5ea 100644 --- a/java/CMakeLists.txt +++ b/java/CMakeLists.txt @@ -24,7 +24,7 @@ add_compile_options( -ffunction-sections -fdata-sections -Wall - -std=c++11) + -std=c++14) file(GLOB jni_SRC jni/*.cpp) diff --git a/javascript/CMakeLists.txt b/javascript/CMakeLists.txt index 1068ec89..18353807 100644 --- a/javascript/CMakeLists.txt +++ b/javascript/CMakeLists.txt @@ -14,7 +14,7 @@ file(GLOB SOURCES include_directories(..) -set(CXX_STANDARD, 11) +set(CXX_STANDARD, 14) add_compile_definitions( EMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0)