From 78f6173486f98e5dbaa15e3809cd6689372f2a7d Mon Sep 17 00:00:00 2001 From: seleznevae Date: Fri, 16 Nov 2018 21:16:05 +0300 Subject: [PATCH] [A] Added tests without wchar support --- .travis.yml | 12 ++++++++++++ CMakeLists.txt | 6 +++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c8790a5..1d11860 100644 --- a/.travis.yml +++ b/.travis.yml @@ -110,6 +110,18 @@ script: - ./libfort_test_dev - ./libfort_test + # Test without WCHAR support + - cd .. + - rm -r build/* + - mkdir -p build + - cd build + - cmake .. -DFORT_ENABLE_WCHAR=OFF + - cmake --build . --target all + - ls + - ./libfort_example + - ./libfort_test_dev + - ./libfort_test + # Test build without optimizations and with ubsan - | if [ "${CC}" = 'gcc-7' ]; then diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e49a5a..8996144 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,7 @@ include(${CMAKE_ROOT}/Modules/ExternalProject.cmake) # Built options option(FORT_CXX_BUILD "Compile with c++ compiler instead of c" OFF) option(FORT_ENABLE_ASTYLE "Enable astyle" OFF) +option(FORT_ENABLE_WCHAR "Enable wchar support" ON) set(FORT_BUILD_TYPE "common" CACHE STRING "Build types(common, asan, ubsan, coveralls)") @@ -26,7 +27,10 @@ set(CMAKE_VERBOSE_MAKEFILE ON) # ------------------------------------------------------------------------------ # Add WChar support for the build # ------------------------------------------------------------------------------ -add_definitions(-DFT_CONGIG_HAVE_WCHAR) +if(FORT_ENABLE_WCHAR) + add_definitions(-DFT_CONGIG_HAVE_WCHAR) +endif(FORT_ENABLE_WCHAR) + # ------------------------------------------------------------------------------ # Includes