From f223a12fed6757e8df68ebab3c4fee2ea64bef69 Mon Sep 17 00:00:00 2001 From: seleznevae Date: Sun, 19 May 2019 19:09:11 +0300 Subject: [PATCH] [C] Improved cmake files consistency --- .cirrus.yml | 6 +++--- .travis.yml | 8 ++++---- CMakeLists.txt | 8 ++++++-- appveyor.yml | 2 +- lib/CMakeLists.txt | 1 - src/CMakeLists.txt | 1 - tests/CMakeLists.txt | 1 - 7 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index fb41546..9761f6a 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -27,7 +27,7 @@ main_task: # Test build without optimizations and with asan - mkdir -p build - cd build - - cmake .. -DFORT_BUILD_TYPE=asan + - cmake .. -DFORT_BUILD_TYPE=asan -DCMAKE_BUILD_TYPE=Debug - cmake --build . --target all - ls - ctest -VV @@ -37,7 +37,7 @@ main_task: # Test build without optimizations and with ubsan - mkdir -p build - cd build - - cmake .. -DFORT_BUILD_TYPE=ubsan + - cmake .. -DFORT_BUILD_TYPE=ubsan -DCMAKE_BUILD_TYPE=Debug - cmake --build . --target all - ls - ctest -VV @@ -47,7 +47,7 @@ main_task: # Test without WCHAR support - mkdir -p build - cd build - - cmake .. -DFORT_ENABLE_WCHAR=OFF + - cmake .. -DFORT_ENABLE_WCHAR=OFF -DCMAKE_BUILD_TYPE=Debug - cmake --build . --target all - ls - ctest -VV diff --git a/.travis.yml b/.travis.yml index 2d659b4..d16c196 100644 --- a/.travis.yml +++ b/.travis.yml @@ -191,7 +191,7 @@ script: # Test build without optimizations and with asan - mkdir -p build - cd build - - cmake .. -DFORT_BUILD_TYPE=asan + - cmake .. -DFORT_BUILD_TYPE=asan -DCMAKE_BUILD_TYPE=Debug - cmake --build . --target all - ls - ctest -VV @@ -201,7 +201,7 @@ script: - rm -r build/* - mkdir -p build - cd build - - cmake .. -DFORT_ENABLE_WCHAR=OFF + - cmake .. -DFORT_ENABLE_WCHAR=OFF -DCMAKE_BUILD_TYPE=Debug - cmake --build . --target all - ls - ctest -VV @@ -212,7 +212,7 @@ script: cd .. ; rm -r build/* ; cd build ; - cmake .. -DFORT_BUILD_TYPE=ubsan ; + cmake .. -DFORT_BUILD_TYPE=ubsan -DCMAKE_BUILD_TYPE=Debug ; cmake --build . --target all ; ls ; ctest -VV; @@ -258,7 +258,7 @@ script: cd .. ; rm -r build/* ; cd build ; - cmake .. -DFORT_BUILD_TYPE=coveralls ; + cmake .. -DFORT_BUILD_TYPE=coveralls -DCMAKE_BUILD_TYPE=Debug ; cmake --build . --target all ; ls ; ./tests/libfort_test_dev ; diff --git a/CMakeLists.txt b/CMakeLists.txt index f49c01b..3b54fbb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,6 +27,10 @@ endif() set(CMAKE_VERBOSE_MAKEFILE ON) +message(STATUS "libfort build options: " + " wchar support = ${FORT_ENABLE_WCHAR}; " + " build type = ${FORT_BUILD_TYPE}") + # ------------------------------------------------------------------------------ # Warnings # ------------------------------------------------------------------------------ @@ -59,8 +63,8 @@ else() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ADDITIONAL_WARNINGS} -Wpedantic") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ADDITIONAL_WARNINGS}") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -std=c99 ") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -std=c++11") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 ") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") endif() # ------------------------------------------------------------------------------ diff --git a/appveyor.yml b/appveyor.yml index ef66cf9..16a3078 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -14,7 +14,7 @@ install: before_build: - mkdir build - cd build - - cmake -G "Visual Studio 15 2017 Win64" .. + - cmake -DCMAKE_BUILD_TYPE=Debug --G "Visual Studio 15 2017 Win64" .. - dir build: diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index be8cda0..1cc56df 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -1,6 +1,5 @@ option(FORT_HAVE_WCHAR "Enable wchar support" ON) -message("FORT_HAVE_WCHAR in fort = ${FORT_HAVE_WCHAR}") add_library(fort fort.c) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1a1cc80..5b2115a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,7 +1,6 @@ option(FORT_HAVE_WCHAR "Enable wchar support" ON) option(FORT_TEST_BUILD "Export some internal symbols for tests" ON) -message("FORT_HAVE_WCHAR in fort_dev = ${FORT_HAVE_WCHAR}") add_library(fort_dev fort_impl.c vector.c diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 288da72..275b8dc 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,7 +1,6 @@ option(FORT_HAVE_WCHAR "Enable wchar support" ON) option(FORT_TEST_BUILD "Export some internal symbols for tests" ON) -message("FORT_HAVE_WCHAR in tests = ${FORT_HAVE_WCHAR}") add_executable(${PROJECT_NAME}_test_dev main_test.c