From 188af31e4638c1720a086354b5fa0ce1da0215b4 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Wed, 4 Jun 2025 15:47:41 -0700 Subject: [PATCH] build: define `CF_WINDOWS_EXECUTABLE_INITIALIZER` When building statically, define `CF_WINDOWS_EXECUTABLE_INITIALIZER` to ensure that the runtime constructor is registered and invoked properly. This is required to initialise CoreFoundation and `Foundation.Bundle`. --- Sources/CoreFoundation/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Sources/CoreFoundation/CMakeLists.txt b/Sources/CoreFoundation/CMakeLists.txt index 9afac9e972..bb01502580 100644 --- a/Sources/CoreFoundation/CMakeLists.txt +++ b/Sources/CoreFoundation/CMakeLists.txt @@ -99,7 +99,8 @@ add_library(CoreFoundation STATIC CFWindowsUtilities.c CFXMLPreferencesDomain.c uuid.c) - +target_compile_definitions(CoreFoundation PRIVATE + $<$,$>>:CF_WINDOWS_EXECUTABLE_INITIALIZER>) target_include_directories(CoreFoundation PUBLIC include