Skip to content

Commit 51be7d1

Browse files
authored
build: define CF_WINDOWS_EXECUTABLE_INITIALIZER (#5224)
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`.
1 parent 7d21208 commit 51be7d1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Sources/CoreFoundation/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ add_library(CoreFoundation STATIC
9999
CFWindowsUtilities.c
100100
CFXMLPreferencesDomain.c
101101
uuid.c)
102-
102+
target_compile_definitions(CoreFoundation PRIVATE
103+
$<$<AND:$<PLATFORM_ID:Windows>,$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>>:CF_WINDOWS_EXECUTABLE_INITIALIZER>)
103104
target_include_directories(CoreFoundation
104105
PUBLIC
105106
include

0 commit comments

Comments
 (0)