This is an automated email from the ASF dual-hosted git repository.
jianliangqi pushed a commit to branch clucene
in repository https://gitbox.apache.org/repos/asf/doris-thirdparty.git
The following commit(s) were added to refs/heads/clucene by this push:
new 70c1a692 [feature](cmake) coverage compilation option added (#136)
70c1a692 is described below
commit 70c1a692bbb1277f107ff2ddedda41b3a223c632
Author: zzzxl <[email protected]>
AuthorDate: Thu Nov 16 17:12:11 2023 +0800
[feature](cmake) coverage compilation option added (#136)
---
CMakeLists.txt | 5 +++++
src/contribs-lib/CMakeLists.txt | 5 +++++
2 files changed, 10 insertions(+)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fdc63bad..ad3af59e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -51,6 +51,11 @@ ELSE(NOT CMAKE_BUILD_TYPE)
MESSAGE( "Compiling as ${CMAKE_BUILD_TYPE}" )
ENDIF(NOT CMAKE_BUILD_TYPE)
+option(ENABLE_CLANG_COVERAGE "coverage option" OFF)
+if (ENABLE_CLANG_COVERAGE AND ENABLE_CLANG_COVERAGE STREQUAL ON AND
COMPILER_CLANG)
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-instr-generate
-fcoverage-mapping")
+endif ()
+
OPTION(ENABLE_DEBUG
"enable debug support"
OFF)
diff --git a/src/contribs-lib/CMakeLists.txt b/src/contribs-lib/CMakeLists.txt
index afc752e8..c220bca9 100644
--- a/src/contribs-lib/CMakeLists.txt
+++ b/src/contribs-lib/CMakeLists.txt
@@ -6,6 +6,11 @@ ADD_DEFINITIONS(${EXTRA_OPTIONS} -DMAKE_CLUCENE_CONTRIBS_LIB)
set(CMAKE_MODULE_PATH "${clucene-contribs-lib_SOURCE_DIR}/cmake")
+option(ENABLE_CLANG_COVERAGE "coverage option" OFF)
+if (ENABLE_CLANG_COVERAGE AND ENABLE_CLANG_COVERAGE STREQUAL ON AND
COMPILER_CLANG)
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-instr-generate
-fcoverage-mapping")
+endif ()
+
#add the files to our groups and core
SOURCE_GROUP("analysis" ./CLucene/analysis/*)
SOURCE_GROUP("util" ./CLucene/util/*)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]