Skip to content

Commit e293376

Browse files
committed
build: add support for building UUID
Add support for building the bundled UUID library. This ensures that the UUID behaviours are the same across the different environments and is needed for supporting Windows which uses some of the UUID APIs which are not available.
1 parent 60651e2 commit e293376

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,17 @@ ExternalProject_Add(CoreFoundation
5757
${CMAKE_COMMAND} -E env --unset=DESTDIR ${CMAKE_COMMAND} --build . --target install)
5858
ExternalProject_Get_Property(CoreFoundation install_dir)
5959

60+
add_library(uuid
61+
STATIC
62+
uuid/uuid.h
63+
uuid/uuid.c)
64+
# Add an include directory for the CoreFoundation framework headers to satisfy
65+
# the dependency on TargetConditionals.h
66+
target_compile_options(uuid
67+
PUBLIC
68+
-I${install_dir}/System/Library/Frameworks/CoreFoundation.framework/Headers)
69+
add_dependencies(uuid CoreFoundation)
70+
6071
set(swift_optimization_flags)
6172
if(CMAKE_BUILD_TYPE MATCHES Release)
6273
set(swift_optimization_flags -O)

0 commit comments

Comments
 (0)