diff --git a/CMakeLists.txt b/CMakeLists.txt index f1de3843a0..e6d0e5190e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -144,6 +144,16 @@ 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")