Skip to content

Commit

Permalink
fixed coverage report
Browse files Browse the repository at this point in the history
  • Loading branch information
benja263 committed Jul 30, 2024
1 parent 9a9e728 commit 3f4627c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ find_package(Python3 COMPONENTS Interpreter Development REQUIRED)
#-- Options
include(CMakeDependentOption)
option(USE_CUDA "Build with GPU acceleration" OFF)
option(COVERAGE "Run coverage report" OFF)

if(DEFINED ENV{COVERAGE} AND $ENV{COVERAGE} STREQUAL "1")
if(COVERAGE)
message(STATUS "Coverage build")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage")
Expand Down
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ def build_extension(self, ext):
'-DPYTHON_INCLUDE_DIR=' + sysconfig.get_path('include'),
'-DCMAKE_BUILD_TYPE=' + cfg,
]
if os.environ.get('COVERAGE', '0') == '1':
cmake_args.append('-DCOVERAGE=ON')
if sysconfig.get_config_var('LIBRARY') is not None:
cmake_args.append('-DPYTHON_LIBRARY=' + sysconfig.get_config_var('LIBRARY'))
if 'CC' in os.environ:
Expand Down

0 comments on commit 3f4627c

Please sign in to comment.