mirror of
https://github.com/curl/curl.git
synced 2026-08-25 09:43:32 +03:00
cmake: limit clang-tidy to the shared libcurl if static is also built
On platforms that require building static and shared libcurl separately, after this change clang-tidy is only run on one of them, to reduce build time by avoiding the double-work. From a clang-tidy standpoint, static and shared libs are identical. Except `dllmain.c` on Windows, which is only present in shared. To keep running it through clang-tidy, prefer the shared library for clang-tidy. Closes #20675
This commit is contained in:
parent
8e3a2a64d1
commit
898ec9f2fb
1 changed files with 3 additions and 0 deletions
|
|
@ -167,6 +167,9 @@ if(BUILD_STATIC_LIBS)
|
|||
set_target_properties(${LIB_STATIC} PROPERTIES INTERPROCEDURAL_OPTIMIZATION TRUE)
|
||||
endif()
|
||||
endif()
|
||||
if(CURL_CLANG_TIDY AND BUILD_SHARED_LIBS) # disable clang-tidy for static, and limit to the shared library, if both enabled
|
||||
set_target_properties(${LIB_STATIC} PROPERTIES C_CLANG_TIDY "")
|
||||
endif()
|
||||
if(CURL_CODE_COVERAGE)
|
||||
set_property(TARGET ${LIB_STATIC} APPEND PROPERTY COMPILE_DEFINITIONS ${CURL_COVERAGE_MACROS})
|
||||
set_property(TARGET ${LIB_STATIC} APPEND PROPERTY COMPILE_OPTIONS ${CURL_COVERAGE_CFLAGS})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue