Skip to content

Commit

Permalink
Specify C++17 standard on macOS (microsoft#2520)
Browse files Browse the repository at this point in the history
* Specify C++17 standard on OS X

* Upgrade macOS image in travis

* AppleClang -> Apple + Clang

* Stop travis pipeline if build.sh fails
  • Loading branch information
Sai Vemprala authored Apr 5, 2020
1 parent 6e49372 commit 19ea831
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:

- name: MacOS
os: osx
osx_image: xcode11.3


before_install:
Expand All @@ -38,7 +39,7 @@ before_install:
script:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
./setup.sh;
./build.sh;
./build.sh || travis_terminate 1;
echo "Starting Unity Build!";
cd Unity && ./build.sh 2> Unity_error.txt || ((cat Unity_error.txt | grep -i "error:" -B 10 -A 10) && exit 1);
elif [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
Expand All @@ -48,7 +49,7 @@ script:
cd Unity '&&' build.cmd;
elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
./setup.sh;
./build.sh;
./build.sh || travis_terminate 1;
echo "Starting Unity Build!";
cd Unity && ./build.sh 2> Unity_error.txt || ((cat Unity_error.txt | grep -i "error:" -B 10 -A 10) && exit 1);
fi
8 changes: 3 additions & 5 deletions cmake/cmake-modules/CommonSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,9 @@ macro(CommonSetup)
IF(UNIX)
set(RPC_LIB_DEFINES "-D MSGPACK_PP_VARIADICS_MSVC=0")
set(BUILD_TYPE "linux")

if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
#TODO: need to check why below is needed
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__CLANG__")
if (APPLE)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wstrict-aliasing -D__CLANG__")
else ()
set(CMAKE_CXX_FLAGS "\
-std=c++17 -stdlib=libc++ -ggdb -Wall -Wextra -Wstrict-aliasing -Wunreachable-code -Wcast-qual -Wctor-dtor-privacy \
Expand Down

0 comments on commit 19ea831

Please sign in to comment.