mirror of
https://github.com/curl/curl.git
synced 2026-07-11 08:17:19 +03:00
step 1
This commit is contained in:
parent
5ef4451f7b
commit
d1b81352e8
4 changed files with 17 additions and 1 deletions
|
|
@ -311,6 +311,19 @@ if(CURL_CLANG_TIDY)
|
|||
endif()
|
||||
endif()
|
||||
|
||||
option(CURL_CODE_COVERAGE "Enable code coverage build options" OFF)
|
||||
if(CURL_CODE_COVERAGE)
|
||||
set(CURL_CFLAGS_COVERAGE "")
|
||||
set(CURL_LIBS_COVERAGE "")
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||
string(APPEND CURL_CFLAGS_COVERAGE " -DNDEBUG -O0 -g -fprofile-arcs -ftest-coverage")
|
||||
list(APPEND CURL_LIBS_COVERAGE "gcov")
|
||||
elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
string(APPEND CURL_CFLAGS_COVERAGE " -DNDEBUG -O0 -g -fprofile-arcs -ftest-coverage")
|
||||
list(APPEND CURL_LIBS_COVERAGE "llvm-gcov")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# For debug libs and exes, add "-d" postfix
|
||||
if(NOT DEFINED CMAKE_DEBUG_POSTFIX)
|
||||
set(CMAKE_DEBUG_POSTFIX "-d")
|
||||
|
|
@ -1983,7 +1996,7 @@ if(WIN32)
|
|||
endif()
|
||||
endif()
|
||||
|
||||
list(APPEND CURL_LIBS ${CURL_NETWORK_AND_TIME_LIBS})
|
||||
list(APPEND CURL_LIBS ${CURL_NETWORK_AND_TIME_LIBS} ${CURL_LIBS_COVERAGE})
|
||||
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "MSVC") # MSVC but exclude clang-cl
|
||||
set_property(DIRECTORY APPEND PROPERTY COMPILE_OPTIONS "-MP") # Parallel compilation
|
||||
|
|
|
|||
|
|
@ -229,6 +229,7 @@ target_link_libraries(my_target PRIVATE CURL::libcurl)
|
|||
- `BUILD_TESTING`: Build tests. Default: `ON`
|
||||
- `CURL_CLANG_TIDY`: Run the build through `clang-tidy`. Default: `OFF`
|
||||
- `CURL_CLANG_TIDYFLAGS`: Custom options to pass to `clang-tidy`. Default: (empty)
|
||||
- `CURL_CODE_COVERAGE`: Enable code coverage build options. Default: `OFF`
|
||||
- `CURL_COMPLETION_FISH`: Install fish completions. Default: `OFF`
|
||||
- `CURL_COMPLETION_FISH_DIR`: Custom fish completion install directory.
|
||||
- `CURL_COMPLETION_ZSH`: Install zsh completions. Default: `OFF`
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
set(LIBCURL_OUTPUT_NAME "${LIB_NAME}" CACHE STRING "Basename of the curl library")
|
||||
|
||||
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS ${CURL_DEBUG_MACROS} "BUILDING_LIBCURL")
|
||||
set_property(DIRECTORY APPEND PROPERTY COMPILE_OPTIONS ${CURL_CFLAGS_COVERAGE})
|
||||
|
||||
configure_file("curl_config.h.cmake" "${CMAKE_CURRENT_BINARY_DIR}/curl_config.h")
|
||||
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
###########################################################################
|
||||
|
||||
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS "${CURL_DEBUG_MACROS}")
|
||||
set_property(DIRECTORY APPEND PROPERTY COMPILE_OPTIONS ${CURL_CFLAGS_COVERAGE})
|
||||
|
||||
set(_curl_cfiles_gen "")
|
||||
set(_curl_hfiles_gen "")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue