From afc1108659074fdfa1e51545e65ed8d444096bd4 Mon Sep 17 00:00:00 2001 From: Shawn Presser Date: Tue, 14 May 2019 05:25:35 -0700 Subject: [PATCH] Fix cmake build / update CMakeLists.txt to use C++11 (#887) Summary: On MacOS, the following steps result in build errors: ``` mkdir build cd build cmake .. make ``` The problem is that yogacore uses C++11 features (`constexpr`) but C++11 isn't specified in CMakeLists.txt. This PR solves the poblem by adding the following code to the bottom of CMakeLists.txt: ``` set_target_properties(yogacore PROPERTIES CXX_STANDARD 11) ``` This solution was derived from https://stackoverflow.com/questions/45688522/how-to-enable-c17-in-cmake Pull Request resolved: https://github.com/facebook/yoga/pull/887 Differential Revision: D15334282 Pulled By: davidaurelio fbshipit-source-id: a599d8a8f555f7f9cd8dc333e12dc2387d5b2d7a --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a89aced..ed4eff5c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,3 +13,4 @@ file(GLOB yogacore_SRC yoga/*.cpp) add_library(yogacore STATIC ${yogacore_SRC}) target_link_libraries(yogacore android log) +set_target_properties(yogacore PROPERTIES CXX_STANDARD 11)