mirror of
https://github.com/curl/curl.git
synced 2026-07-30 08:48:02 +03:00
cmake: fix unity with Windows Unicode + TrackMemory
Found the root cause of the startup crash in unity builds with Unicode and TrackMemory enabled at the same time. We must make sure that the `memdebug.h` header doesn't apply to `lib/curl_multibyte.c` (as even noted in a comment there.) In unity builds all headers apply to all sources, including `curl_multibyte.c`. This probably resulted in an infinite loop on startup. Exclude this source from unity compilation with TrackMemory enabled, in both libcurl and curl tool. Enable unity mode for a debug Unicode CI job to keep it tested. Also delete the earlier workaround that fully disabled unity for affected builds. Follow-up tod82b080f63#12005 Follow-up to3f8fc25720#11095 Closes #11928
This commit is contained in:
parent
d82b080f63
commit
f42a279ee3
4 changed files with 11 additions and 14 deletions
|
|
@ -56,9 +56,9 @@ add_library(
|
|||
target_compile_definitions(curlu PUBLIC UNITTESTS CURL_STATICLIB)
|
||||
|
||||
if(ENABLE_CURLDEBUG)
|
||||
# We must compile memdebug.c separately to avoid memdebug.h redefinitions
|
||||
# being applied to memdebug.c itself.
|
||||
set_source_files_properties(memdebug.c PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
|
||||
# We must compile these sources separately to avoid memdebug.h redefinitions
|
||||
# applying to them.
|
||||
set_source_files_properties(memdebug.c curl_multibyte.c PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
|
||||
endif()
|
||||
target_link_libraries(curlu PRIVATE ${CURL_LIBS})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue