Skip to content

Commit f857062

Browse files
committed
Add CMake build types including coverage build
1 parent e626578 commit f857062

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ env:
1010
- MPICH_BOT_URL_HEAD="https://github.com/sourceryinstitute/opencoarrays/files/64308/"
1111
- MPICH_BOT_URL_TAIL="mpich-3.2.yosemite.bottle.1.tar.gz"
1212
- OSX_PACKAGES="gcc cmake"
13+
- BUILD_TYPE="CodeCoverage"
1314

1415
matrix:
1516
include:
@@ -101,22 +102,21 @@ before_script:
101102
script:
102103
- mkdir cmake-build
103104
- cd cmake-build
104-
- cmake -DCMAKE_INSTALL_PREFIX:PATH="$HOME/OpenCoarrays" -DCMAKE_Fortran_FLAGS='-ftest-coverage -fprofile-arcs -O0' -DCMAKE_C_FLAGS='-fprofile-arcs -ftest-coverage -O0' ..
105+
- cmake -DCMAKE_INSTALL_PREFIX:PATH="$HOME/OpenCoarrays" -DCMAKE_BUILD_TYPE="$BUILD_TYPE" ..
105106
- make -j 4
106107
- ctest --verbose
107108
- make install
108109
- cd ..
109110

110111
after_success:
111112
- find . -name '*.gcno' -print
112-
- find . -name '*.gcda' -print
113113
- gcov-5 --version
114114
- bash <(curl -s https://codecov.io/bash) -x $(which gcov-5)
115115

116116
notifications:
117117
webhooks:
118118
urls:
119-
- $GITTERHOOK_URL
119+
- https://webhooks.gitter.im/e/93dbafbdf76c1732a623
120120
on_success: change # options: [always|never|change]
121121
on_failure: always
122122
on_start: always

CMakeLists.txt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
cmake_minimum_required(VERSION 3.0)
22

3+
# Set the type/configuration of build to perform
4+
set ( CMAKE_CONFIGURATION_TYPES "Debug" "Release" "MinSizeRel" "RelWithDebInfo" "CodeCoverage" )
5+
set ( CMAKE_BUILD_TYPE "Release"
6+
CACHE STRING "Select which configuration to build." )
7+
set_property ( CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${CMAKE_CONFIGURATION_TYPES} )
8+
39
#Name project and specify source languages
410
project(opencoarrays VERSION 1.2.2 LANGUAGES C Fortran)
511

@@ -26,7 +32,11 @@ endif()
2632
#Report untested Fortran compiler unless explicitly directed to build all examples.
2733
if ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU" )
2834
set(gfortran_compiler true)
29-
# add_definitions(-DPREFIX_NAME=_gfortran_caf_)
35+
# add_definitions(-DPREFIX_NAME=_gfortran_caf_)
36+
set ( CMAKE_C_FLAGS_CODECOVERAGE "-fprofile-arcs -ftest-coverage -O0"
37+
CACHE STRING "Code coverage C compiler flags")
38+
set ( CMAKE_Fortran_FLAGS_CODECOVERAGE "-fprofile-arcs -ftest-coverage -O0"
39+
CACHE STRING "Code coverage C compiler flags")
3040
else()
3141
message(WARNING
3242
"\n"

0 commit comments

Comments
 (0)