.travis.yml:add c++11 flag for osx (#236)

* .travis.yml:add c++11 flag for osx

fixes #233

And correct flags for model_import_export, edit BUILD.md
This commit is contained in:
Andy Alt
2018-09-18 18:29:37 -05:00
committed by GitHub
parent 37c8030cae
commit 23f4f5c5e7
3 changed files with 11 additions and 7 deletions

View File

@@ -50,7 +50,9 @@ before_install:
# ^ odd linking problems related with brew which is not creating links # ^ odd linking problems related with brew which is not creating links
- if [ "$TRAVIS_OS_NAME" = "osx" ] && [ "$Tr_Xcode_Version" = "6.4" ]; then brew install Caskroom/cask/xquartz; fi - if [ "$TRAVIS_OS_NAME" = "osx" ] && [ "$Tr_Xcode_Version" = "6.4" ]; then brew install Caskroom/cask/xquartz; fi
- if [ "$Tr_Compiler_Version" != "" ] && [ "$Tr_Compiler_Version" != "default" ] && [ "$CC" = "gcc" ]; then export CXX="g++-${Tr_Compiler_Version}" CC="gcc-${Tr_Compiler_Version}"; fi - if [ "$Tr_Compiler_Version" != "" ] && [ "$Tr_Compiler_Version" != "default" ] && [ "$CC" = "gcc" ]; then export CXX="g++-${Tr_Compiler_Version}" CC="gcc-${Tr_Compiler_Version}"; fi
- if [ "$Tr_Compiler_Version" != "" ] && [ "$Tr_Compiler_Version" != "default" ] && [ "$CC" == "clang" ]; then export CXX="clang++-${Tr_Compiler_Version}" CC="clang-${Tr_Compiler_Version}"; fi - if [ "$Tr_Compiler_Version" != "" ] && [ "$Tr_Compiler_Version" != "default" ] && [ "$CC" == "clang" ]; then
export CXX="clang++-${Tr_Compiler_Version}" CC="clang-${Tr_Compiler_Version}";
fi
- $CC --version - $CC --version
- $CXX --version - $CXX --version
- cmake --version - cmake --version
@@ -60,7 +62,7 @@ script:
- if [ "$TRAVIS_OS_NAME" = "linux" ] && [ "$(echo "$CC" | grep 'clang')" = "" ]; then - if [ "$TRAVIS_OS_NAME" = "linux" ] && [ "$(echo "$CC" | grep 'clang')" = "" ]; then
mkdir build; mkdir build;
cd build; cd build;
cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/local -DBUILD_MODEL_VIEWER=ON -DBUILD_MAP_EDITOR=ON -DBUILD_IMPORT_EXPORT_TOOLS=ON -DBUILD_ZETAGLEST_TESTS=ON; cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/local -DBUILD_MODEL_VIEWER=ON -DBUILD_MAP_EDITOR=ON -DBUILD_MODEL_IMPORT_EXPORT_TOOLS=ON -DBUILD_ZETAGLEST_TESTS=ON;
make && make install; make && make install;
fi fi
- if [ "$TRAVIS_OS_NAME" = "linux" ] && [ "$(echo "$CC" | grep 'clang')" != "" ]; then - if [ "$TRAVIS_OS_NAME" = "linux" ] && [ "$(echo "$CC" | grep 'clang')" != "" ]; then
@@ -72,11 +74,8 @@ script:
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then - if [ "$TRAVIS_OS_NAME" = "osx" ]; then
mkdir build; mkdir build;
cd build; cd build;
cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/local -DBUILD_MODEL_VIEWER=ON -DBUILD_MAP_EDITOR=ON -DBUILD_IMPORT_EXPORT_TOOLS=ON; cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/local -DBUILD_MODEL_VIEWER=ON -DBUILD_MAP_EDITOR=ON -DBUILD_MODEL_IMPORT_EXPORT_TOOLS=ON -DBUILD_ZETAGLEST_TESTS=ON;
make && make install; make && make install;
echo 'Mini test:';
echo '>>> zetaglest --version';
./zetaglest --version | head -3;
echo 'Dependencies:'; echo 'Dependencies:';
otool -L zetaglest; otool -L zetaglest;
fi fi

View File

@@ -72,7 +72,7 @@ To edit maps:
Use model import export tools: Use model import export tools:
BUILD_IMPORT_EXPORT_TOOLS=ON (off by default) BUILD_MODEL_IMPORT_EXPORT_TOOLS=ON (off by default)
The **wxWidgets (libwxgtk3.0-dev on some systems)** and **libxml2-dev* The **wxWidgets (libwxgtk3.0-dev on some systems)** and **libxml2-dev*
dependencies (mentioned below) is only required if you enable those dependencies (mentioned below) is only required if you enable those

View File

@@ -7,6 +7,11 @@ SET(TARGET_NAME "zetaglest_tests")
IF(BUILD_ZETAGLEST_TESTS) IF(BUILD_ZETAGLEST_TESTS)
MESSAGE(STATUS "Build ${TARGET_NAME} = YES") MESSAGE(STATUS "Build ${TARGET_NAME} = YES")
# The tests fail on Travis with clang on osx because of the use of "bind"
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
endif()
INCLUDE (CheckIncludeFiles) INCLUDE (CheckIncludeFiles)
FIND_PACKAGE(CppUnit REQUIRED) FIND_PACKAGE(CppUnit REQUIRED)