mirror of
https://github.com/curl/curl.git
synced 2026-07-24 04:27:16 +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
|
|
@ -67,6 +67,12 @@ if(BUILD_STATIC_CURL)
|
|||
set(CURLX_CFILES ${CURLTOOL_LIBCURL_CFILES})
|
||||
endif()
|
||||
|
||||
if(ENABLE_CURLDEBUG)
|
||||
# We must compile this source separately to avoid memdebug.h redefinitions
|
||||
# applying to them.
|
||||
set_source_files_properties(../lib/curl_multibyte.c PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
|
||||
endif()
|
||||
|
||||
add_executable(
|
||||
${EXE_NAME}
|
||||
${CURL_CFILES} ${CURLX_CFILES} ${CURL_HFILES}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue