diff --git a/CMakeLists.txt b/CMakeLists.txt index e6d0e5190e..f1de3843a0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -144,16 +144,6 @@ if(ENABLE_CURLDEBUG) set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS CURLDEBUG) endif() -# This combination results in curl tool crashing on startup when run on native -# Windows (it was seen to work when run under WINE though). We disable UNITY -# mode as a workaround. -if(ENABLE_UNICODE AND ENABLE_CURLDEBUG) - set(CMAKE_UNITY_BUILD OFF) - message(WARNING "Unity builds are not supported with Windows Unicode and " - "TrackMemory (-DCURLDEBUG) enabled at the same time. Unity mode has been " - "disabled.") -endif() - # For debug libs and exes, add "-d" postfix if(NOT DEFINED CMAKE_DEBUG_POSTFIX) set(CMAKE_DEBUG_POSTFIX "-d") diff --git a/appveyor.yml b/appveyor.yml index 70da472ded..7d0be9bcc2 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -121,7 +121,7 @@ environment: DISABLED_TESTS: '!1139 !1501' ADD_PATH: 'C:\msys64\usr\bin' # generated CMake-based MSYS Makefiles builds (mingw cross-compiling) - - job_name: 'CMake, mingw-w64, gcc 8, Debug x64, Schannel, Static, Unicode' + - job_name: 'CMake, mingw-w64, gcc 8, Debug x64, Schannel, Static, Unicode, Unity' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' BUILD_SYSTEM: CMake PRJ_GEN: 'MSYS Makefiles' @@ -134,6 +134,7 @@ environment: ADD_PATH: 'C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin;C:\msys64\usr\bin' MSYS2_ARG_CONV_EXCL: '/*' BUILD_OPT: -k + UNITY: 'ON' - job_name: 'CMake, mingw-w64, gcc 7, Debug x64, Schannel, Static, Unicode' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' BUILD_SYSTEM: CMake diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 83c0a53f28..6f849199cb 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -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}) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3d6334b2cf..f6517c7036 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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}