Skip to content

Commit 4d28851

Browse files
committed
Runtimes: rename Core/core to Core/Core (uppercase C) so it appears...
higher in case sensitive directory listings (like GitHub). This will ease checking for stdlib code on small screens without needing to scroll. Git will not take care of adjusting the case if the folder contains untracked files (which is the case after syncing the source from the stdlib fodler) -- to account for this, have the resync script perform the rename if need be, so we don't have errors when invoking the Runtime build system (since CMake considers paths as case sensitive regardless of the underlying file system). Addresses rdar://164195263
1 parent a6cae4a commit 4d28851

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

Runtimes/Core/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ add_subdirectory(Demangling)
206206
add_subdirectory(Threading)
207207
add_subdirectory(runtime)
208208
add_subdirectory(stubs)
209-
add_subdirectory(core)
209+
add_subdirectory(Core)
210210
if(SwiftCore_ENABLE_COMMANDLINE_SUPPORT)
211211
add_subdirectory(CommandLineSupport)
212212
endif()
File renamed without changes.

Runtimes/Resync.cmake

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ set(CoreLibs
8686
CompatibilityOverride
8787
stubs
8888
CommandLineSupport
89-
core
9089
SwiftOnoneSupport
9190
RemoteInspection
9291
SwiftRemoteMirror
@@ -97,6 +96,20 @@ foreach(library ${CoreLibs})
9796
copy_library_sources(${library} "public" "Core")
9897
endforeach()
9998

99+
# copying Core/core separately, so we can amend the case of the target folders
100+
# on case insensitive file systems
101+
if(IS_READABLE "${CMAKE_CURRENT_LIST_DIR}/Core/core")
102+
# If we can see the old lower case name, it means that Git did not perform the rename
103+
# because we have untracked content (likely the sources from the stdlib)
104+
# Perform the rename now so that CMake is able to find the folder (since it seems
105+
# to be always case sensitive)
106+
message(STATUS "Renaming ${CMAKE_CURRENT_LIST_DIR}/Core/core (lowercase) to ${CMAKE_CURRENT_LIST_DIR}/Core/Core (uppercase)")
107+
file(RENAME "${CMAKE_CURRENT_LIST_DIR}/Core/core" "${CMAKE_CURRENT_LIST_DIR}/Core/core.casechange")
108+
file(RENAME "${CMAKE_CURRENT_LIST_DIR}/Core/core.casechange" "${CMAKE_CURRENT_LIST_DIR}/Core/Core")
109+
endif()
110+
copy_library_sources("" "public/core" "Core/Core")
111+
112+
100113
message(STATUS "plist[${StdlibSources}/Info.plist.in] -> Core/Info.plist.in")
101114
copy_files("" "Core" FILES "Info.plist.in")
102115

0 commit comments

Comments
 (0)