diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..83c4bb8 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,66 @@ +language: cpp + +matrix: + include: + + - os: linux + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-7 + env: + - MATRIX_EVAL="CC=gcc-7 && CXX=g++-7" + + - os: linux + dist: bionic + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-7 + env: + - MATRIX_EVAL="CC=gcc-7 && CXX=g++-7" + + - os: linux + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-8 + env: + - MATRIX_EVAL="CC=gcc-8 && CXX=g++-8" + + - os: linux + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-9 + env: + - MATRIX_EVAL="CC=gcc-9 && CXX=g++-9" + + - os: linux + dist: bionic + addons: + apt: + sources: + - llvm-toolchain-trusty-6.0 + packages: + - clang-6.0 + env: + - MATRIX_EVAL="CC=clang-6.0 && CXX=clang++-6.0" + +before_install: + - eval "${MATRIX_EVAL}" + +script: + - mkdir -p build + - cd build + - cmake -DENABLE_DATE_TESTING=ON -DBUILD_SHARED_LIBS=ON -DCOMPILE_WITH_C_LOCALE=ON .. + - make -j$(nproc) + - make testit -j$(nproc) \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 2d8462d..344c7d4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,6 +14,12 @@ option( USE_TZ_DB_IN_DOT "Save the timezone database in the current folder" OFF option( BUILD_SHARED_LIBS "Build a shared version of library" OFF ) option( ENABLE_DATE_TESTING "Enable unit tests" ON ) option( DISABLE_STRING_VIEW "Disable string view" OFF ) +option( COMPILE_WITH_C_LOCALE "pass -DONLY_C_LOCALE=1 to copiler") + +if(COMPILE_WITH_C_LOCALE) + #To workaround libstdc++ issue https://github.com/HowardHinnant/date/issues/388 + add_definitions(-DONLY_C_LOCALE=1) +endif() function( print_option OPT ) if ( NOT DEFINED PRINT_OPTION_CURR_${OPT} OR ( NOT PRINT_OPTION_CURR_${OPT} STREQUAL ${OPT} ) ) diff --git a/README.md b/README.md index c0df80f..04ae8da 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # Date +[![Build Status](https://travis-ci.org/miketsukerman/date.svg?branch=add-continues-integration)](https://travis-ci.org/miketsukerman/date) [![Join the chat at https://gitter.im/HowardHinnant/date](https://badges.gitter.im/HowardHinnant/date.svg)](https://gitter.im/HowardHinnant/date?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) ---