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
This commit is contained in:
Shawn Presser
2019-05-14 05:25:35 -07:00
committed by Facebook Github Bot
parent a15bf6e701
commit afc1108659

View File

@@ -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)