Skip to content

Commit

Permalink
Bugfix/build variant (#89)
Browse files Browse the repository at this point in the history
* Document update

* Script forgotten comment update

* BuildVariant scope bug fix
  • Loading branch information
Ahmet İbrahim AKSOY authored Nov 22, 2021
1 parent 91a6737 commit 561a5d8
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,8 @@ make_target(TYPE UNIT_TEST WITH_COVERAGE)
# Creates an unit test named my-awesome-project and my-awesome-project.cov coverage target.
```

**Note: When you want to use `<project_name>_TOOLCONF_USE_COVERAGE` option, you have to delete or comment out `<project_name>_TOOLCONF_USE_GCOV` and `<project_name>_TOOLCONF_USE_LLVM_COV` options from your CMakeLists.txt.**

##### An example `lcov` unit test coverage scenario:

In this scenario, we have the following library and the corresponding unit test code:
Expand Down
4 changes: 2 additions & 2 deletions cmake/modules/core/BuildVariant.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
include(CMakeDetermineCCompiler)
include(CMakeDetermineCXXCompiler)

macro(hdk_set_build_variant)
function(hdk_set_build_variant)
hdk_log_set_context("hadouken.buildvariant")
hdk_log_status("Setting up build variant and flags")

Expand Down Expand Up @@ -112,7 +112,7 @@ macro(hdk_set_build_variant)
set(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE} PARENT_SCOPE)
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO} PARENT_SCOPE)
set(CMAKE_CXX_FLAGS_MINSIZEREL ${CMAKE_CXX_FLAGS_MINSIZEREL} PARENT_SCOPE)
endmacro()
endfunction()



Expand Down
2 changes: 1 addition & 1 deletion cmake/modules/core/DiagnosticFlags_Clang.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# SPDX-License-Identifier: Apache 2.0
# ______________________________________________________

set(HADOUKEN_COMPILER CLANG)
set(HADOUKEN_COMPILER CLANG PARENT_SCOPE)

# Clang 3.2 and above
set(CLANG_32_WARN_BUT_NO_ERROR "" )
Expand Down
2 changes: 1 addition & 1 deletion cmake/modules/core/DiagnosticFlags_GCC.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# see: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html for
# all warning flag documentations used in this code

set(HADOUKEN_COMPILER GCC)
set(HADOUKEN_COMPILER GCC PARENT_SCOPE)

##########################################################
# GCC 3.4 and above
Expand Down
2 changes: 1 addition & 1 deletion script/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ SET(${PROJECT_NAME_SANITIZED}_TOOLCONF_USE_CLANG_TIDY FALS
SET(${PROJECT_NAME_SANITIZED}_TOOLCONF_USE_CPPCHECK FALSE CACHE BOOL "Enable/disable cppcheck integration" FORCE)
SET(${PROJECT_NAME_SANITIZED}_TOOLCONF_USE_CCACHE FALSE CACHE BOOL "Enable/disable ccache integration" FORCE)
SET(${PROJECT_NAME_SANITIZED}_TOOLCONF_USE_GCOV FALSE CACHE BOOL "Enable/disable gcov integration" FORCE)
SET(${PROJECT_NAME_SANITIZED}_TOOLCONF_USE_LLVM_COV FALSE CACHE BOOL "Enable/disable gcov integration" FORCE)
SET(${PROJECT_NAME_SANITIZED}_TOOLCONF_USE_LLVM_COV FALSE CACHE BOOL "Enable/disable llvm-cov integration" FORCE)
SET(${PROJECT_NAME_SANITIZED}_TOOLCONF_USE_COVERAGE FALSE CACHE BOOL "Enable/disable automatic coverage selection integration" FORCE)
SET(${PROJECT_NAME_SANITIZED}_TOOLCONF_USE_LCOV FALSE CACHE BOOL "Enable/disable lcov integration" FORCE)
SET(${PROJECT_NAME_SANITIZED}_TOOLCONF_USE_GCOVR FALSE CACHE BOOL "Enable/disable gcovr integration" FORCE)
Expand Down

0 comments on commit 561a5d8

Please sign in to comment.