diff --git a/stdlib/cmake/modules/SwiftSource.cmake b/stdlib/cmake/modules/SwiftSource.cmake index 95fe41128ee85..a6dd1e867a4b5 100644 --- a/stdlib/cmake/modules/SwiftSource.cmake +++ b/stdlib/cmake/modules/SwiftSource.cmake @@ -844,13 +844,17 @@ function(_compile_swift_files endif() endif() - # First generate the obj dirs + # First generate the obj dirs if not created before list(REMOVE_DUPLICATES dirs_to_create) - add_custom_command_target( - create_dirs_dependency_target - COMMAND "${CMAKE_COMMAND}" -E make_directory ${dirs_to_create} - OUTPUT ${dirs_to_create} - COMMENT "Generating dirs for ${first_output}") + list(REMOVE_ITEM dirs_to_create ${CREATED_OBJ_DIRS}) + if(NOT dirs_to_create STREQUAL "") + add_custom_command_target( + create_dirs_dependency_target + COMMAND "${CMAKE_COMMAND}" -E make_directory ${dirs_to_create} + OUTPUT ${dirs_to_create} + COMMENT "Generating dirs for ${first_output}") + set(CREATED_OBJ_DIRS ${CREATED_OBJ_DIRS} ${dirs_to_create} CACHE INTERNAL "Already created obj directories") + endif() # Then we can compile both the object files and the swiftmodule files # in parallel in this target for the object file, and ... diff --git a/stdlib/public/CMakeLists.txt b/stdlib/public/CMakeLists.txt index f2d759a190470..da063e5834712 100644 --- a/stdlib/public/CMakeLists.txt +++ b/stdlib/public/CMakeLists.txt @@ -136,12 +136,3 @@ endif() if(SWIFT_BUILD_SDK_OVERLAY OR SWIFT_BUILD_TEST_SUPPORT_MODULES) add_subdirectory(Platform) endif() - -if(SWIFT_BUILD_SDK_OVERLAY) - # On Apple platforms, we aren't building any overlays (other than Darwin in - # Platform above). Instead, we're picking them up from the SDK. - - if(WINDOWS IN_LIST SWIFT_SDKS) - add_subdirectory(Windows) - endif() -endif() diff --git a/stdlib/public/Platform/CMakeLists.txt b/stdlib/public/Platform/CMakeLists.txt index f958d4ce89954..b0672cd15e219 100644 --- a/stdlib/public/Platform/CMakeLists.txt +++ b/stdlib/public/Platform/CMakeLists.txt @@ -114,6 +114,16 @@ add_swift_target_library(swiftCRT ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_SDK_OVE TARGET_SDKS WINDOWS INSTALL_IN_COMPONENT sdk-overlay) +add_swift_target_library(swiftWinSDK ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY + WinSDK.swift + + SWIFT_COMPILE_FLAGS + ${SWIFT_RUNTIME_SWIFT_COMPILE_FLAGS} + ${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS} + LINK_FLAGS "${SWIFT_RUNTIME_SWIFT_LINK_FLAGS}" + TARGET_SDKS WINDOWS + INSTALL_IN_COMPONENT sdk-overlay) + set(glibc_modulemap_target_list) foreach(sdk ${SWIFT_SDKS}) if(NOT "${sdk}" STREQUAL "LINUX" AND diff --git a/stdlib/public/Windows/WinSDK.swift b/stdlib/public/Platform/WinSDK.swift similarity index 100% rename from stdlib/public/Windows/WinSDK.swift rename to stdlib/public/Platform/WinSDK.swift diff --git a/stdlib/public/Windows/CMakeLists.txt b/stdlib/public/Windows/CMakeLists.txt deleted file mode 100644 index 65a2c8e9011a2..0000000000000 --- a/stdlib/public/Windows/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -add_swift_target_library(swiftWinSDK ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY - WinSDK.swift - - SWIFT_COMPILE_FLAGS ${SWIFT_RUNTIME_SWIFT_COMPILE_FLAGS} ${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS} - LINK_FLAGS "${SWIFT_RUNTIME_SWIFT_LINK_FLAGS}" - TARGET_SDKS WINDOWS - INSTALL_IN_COMPONENT sdk-overlay) -