mirror of
https://github.com/curl/curl.git
synced 2026-08-25 23:33:37 +03:00
cmake: add libcurlu/libcurltool for unit tests
Add a `libcurlu`/`libcurltool` static library that is compiled only for unit tests. We use `EXCLUDE_FROM_ALL` to make sure that they're not built by default, they're only built if unit tests are built. These libraries allow us to compile every unit test with CMake. Closes #11446
This commit is contained in:
parent
c42c6eb245
commit
39e7c22bb4
3 changed files with 19 additions and 10 deletions
|
|
@ -76,6 +76,14 @@ add_executable(
|
|||
ALIAS ${EXE_NAME}
|
||||
)
|
||||
|
||||
add_library(
|
||||
curltool # special libcurltool library just for unittests
|
||||
STATIC
|
||||
EXCLUDE_FROM_ALL
|
||||
${CURL_CFILES} ${CURLX_CFILES} ${CURL_HFILES}
|
||||
)
|
||||
target_compile_definitions(curltool PUBLIC UNITTESTS CURL_STATICLIB)
|
||||
|
||||
if(CURL_HAS_LTO)
|
||||
set_target_properties(${EXE_NAME} PROPERTIES
|
||||
INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue