set CMAKE_CXX_STANDARD=11 and add cxx17 for clang
This commit is contained in:
parent
c88fb1cc9f
commit
6a22533a60
@ -308,6 +308,7 @@ matrix:
|
|||||||
env:
|
env:
|
||||||
- COMPILER=clang++-7
|
- COMPILER=clang++-7
|
||||||
- CXXFLAGS=-std=c++1z
|
- CXXFLAGS=-std=c++1z
|
||||||
|
- CMAKE_CXX_STANDARD=17
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-7']
|
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-7']
|
||||||
@ -331,14 +332,12 @@ script:
|
|||||||
- if [[ "${COMPILER}" != "" ]]; then export CXX=${COMPILER}; fi
|
- if [[ "${COMPILER}" != "" ]]; then export CXX=${COMPILER}; fi
|
||||||
# by default, use the single-header version
|
# by default, use the single-header version
|
||||||
- if [[ "${MULTIPLE_HEADERS}" == "" ]]; then export MULTIPLE_HEADERS=OFF; fi
|
- if [[ "${MULTIPLE_HEADERS}" == "" ]]; then export MULTIPLE_HEADERS=OFF; fi
|
||||||
|
# by default, use the cxx11 standard
|
||||||
|
- if [[ "${CMAKE_CXX_STANDARD}" == "" ]]; then export CMAKE_CXX_STANDARD=11; fi
|
||||||
|
|
||||||
# compile and execute unit tests
|
# compile and execute unit tests
|
||||||
- mkdir -p build && cd build
|
- mkdir -p build && cd build
|
||||||
- if [[ "${CMAKE_CXX_STANDARD}" != "" ]]; then
|
- cmake .. ${CMAKE_OPTIONS} -DJSON_MultipleHeaders=${MULTIPLE_HEADERS} -DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD} -DJSON_BuildTests=On -GNinja && cmake --build . --config Release ;
|
||||||
cmake .. ${CMAKE_OPTIONS} -DJSON_MultipleHeaders=${MULTIPLE_HEADERS} -DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD} -DJSON_BuildTests=On -GNinja && cmake --build . --config Release ;
|
|
||||||
else
|
|
||||||
cmake .. ${CMAKE_OPTIONS} -DJSON_MultipleHeaders=${MULTIPLE_HEADERS} -DJSON_BuildTests=On -GNinja && cmake --build . --config Release ;
|
|
||||||
fi
|
|
||||||
- ctest -C Release --timeout 2700 -V -j
|
- ctest -C Release --timeout 2700 -V -j
|
||||||
- cd ..
|
- cd ..
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user