diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index e939f0ed..0b36974e 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -24,7 +24,7 @@ jobs: # To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list. matrix: os: [ubuntu-latest, windows-latest, macos-latest] - build_type: [Release] + build_type: [Release, coverage] c_compiler: [gcc, clang, cl] include: - os: windows-latest @@ -39,6 +39,8 @@ jobs: exclude: - os: windows-latest c_compiler: gcc + - os: windows-latest + build_type: coverage - os: windows-latest c_compiler: clang - os: ubuntu-latest diff --git a/CMakeLists.txt b/CMakeLists.txt index d4938c71..a5ba6bd2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -72,8 +72,13 @@ if(NOT CMAKE_BUILD_TYPE) message(STATUS "Setting build type to 'release' as none was specified.") set(CMAKE_BUILD_TYPE "release" CACHE STRING "Choose the type of build." FORCE) # Set the possible values of build type for cmake-gui - set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS - "release" "debug" "maintain" "custom") + if(CMAKE_SYSTEM MATCHES "Windows*") + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS + "release" "debug" "maintain" "custom") + else() + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS + "release" "debug" "maintain" "custom" "coverage") + endif() endif() string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE) @@ -109,6 +114,21 @@ if(CMAKE_BUILD_TYPE STREQUAL "debug") endif() +if((NOT CMAKE_SYSTEM MATCHES "Windows*") AND CMAKE_BUILD_TYPE STREQUAL "coverage") + #set(CMAKE_VERBOSE_MAKEFILE ON) + set(SOLID_HAS_DEBUG TRUE) + set(SOLID_HAS_NO_INLINES TRUE) + set(SOLID_HAS_STATISTICS TRUE) + set(SOLID_HAS_ASSERT TRUE) + #force a single configuration type on Windows builds + set(CMAKE_CONFIGURATION_TYPES "debug") + set(CONFIGURATION_TYPE "debug") + add_compile_options("SHELL: -coverage -fprofile-arcs -ftest-coverage") + add_link_options("SHELL: -fprofile-arcs -ftest-coverage") +elseif(CMAKE_SYSTEM MATCHES "Windows*" AND CMAKE_BUILD_TYPE STREQUAL "coverage") + message(FATAL_ERROR "\r\n === Coverage not yet supported for Windows systems ===\r\n") +endif() + if(CMAKE_BUILD_TYPE STREQUAL "custom") #force a single configuration type on Windows builds set(CMAKE_CONFIGURATION_TYPES "custom") @@ -190,7 +210,10 @@ if(CMAKE_SYSTEM MATCHES "Linux*") set(SOLID_ON_POSIX TRUE) - + if(CMAKE_BUILD_TYPE STREQUAL "coverage") + add_link_options("SHELL: -lgcov") + endif() + if(CMAKE_CXX_COMPILER MATCHES "clang") add_compile_options( "$<$:SHELL: ${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -Wall -Wshorten-64-to-32 -Wunreachable-code -Wconditional-uninitialized -Wdelete-non-virtual-dtor -Wnon-virtual-dtor>" @@ -252,8 +275,7 @@ if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm") endif() if(NOT ON_FOUND) - message("\r\n === Unsupported system - please contact project owner ===\r\n") - return() + message(FATAL_ERROR "\r\n === Unsupported system - please contact project owner ===\r\n") endif(NOT ON_FOUND) #----------------------------------------------------------------- diff --git a/solid/frame/mprpc/test/CMakeLists.txt b/solid/frame/mprpc/test/CMakeLists.txt index ae81144f..f418a151 100644 --- a/solid/frame/mprpc/test/CMakeLists.txt +++ b/solid/frame/mprpc/test/CMakeLists.txt @@ -71,6 +71,11 @@ if(OPENSSL_FOUND) test_clientserver_timeout_secure.cpp test_clientserver_topic.cpp ) + + if(SOLID_ON_WINDOWS) + set_source_files_properties(test_clientserver_versioning.cpp PROPERTIES COMPILE_OPTIONS "/bigobj") + endif() + # create_test_sourcelist( mprpcClientServerTests test_mprpc_clientserver.cpp ${mprpcClientServerTestSuite})