File tree Expand file tree Collapse file tree 3 files changed +47
-15
lines changed Expand file tree Collapse file tree 3 files changed +47
-15
lines changed Original file line number Diff line number Diff line change @@ -771,21 +771,17 @@ endif()
771
771
#
772
772
# Set up global CMake variables for API notes.
773
773
#
774
- # API notes version 1.0.0
775
- #
776
- # Change the above comment to 'touch' this file and keep incremental builds
777
- # working when adding a new apinotes file.
778
- #
779
774
set (SWIFT_API_NOTES_PATH "${SWIFT_SOURCE_DIR} /apinotes" )
780
- if (NOT EXISTS "${SWIFT_API_NOTES_PATH} /Foundation.apinotes" )
775
+ include ("${SWIFT_API_NOTES_PATH} /CMakeLists.txt" )
776
+ if (NOT DEFINED SWIFT_API_NOTES_INPUTS )
781
777
message (FATAL_ERROR "API notes are not available in ${SWIFT_API_NOTES_PATH} " )
782
778
endif ()
783
-
784
- file (GLOB SWIFT_API_NOTES_INPUT_FILES "${SWIFT_API_NOTES_PATH} /*.apinotes" )
785
- foreach (file ${SWIFT_API_NOTES_INPUT_FILES} )
786
- get_filename_component (name "${file} " NAME_WE )
787
- list (APPEND SWIFT_API_NOTES_INPUTS ${name} )
788
- endforeach ()
779
+ #
780
+ # file(GLOB SWIFT_API_NOTES_INPUT_FILES "${SWIFT_API_NOTES_PATH}/*.apinotes")
781
+ # foreach(file ${SWIFT_API_NOTES_INPUT_FILES})
782
+ # get_filename_component(name "${file}" NAME_WE)
783
+ # list(APPEND SWIFT_API_NOTES_INPUTS ${name})
784
+ # endforeach()
789
785
790
786
# Add all of the subdirectories, where we actually do work.
791
787
if (SWIFT_BUILD_TOOLS )
Original file line number Diff line number Diff line change
1
+ set (SWIFT_API_NOTES_INPUTS
2
+ AppKit
3
+ AVFoundation
4
+ CoreData
5
+ CoreGraphics
6
+ CoreLocation
7
+ Dispatch
8
+ Foundation
9
+ GameKit
10
+ HomeKit
11
+ NotificationCenter
12
+ ObjectiveC
13
+ SpriteKit
14
+ TVMLKit
15
+ TVServices
16
+ UIKit
17
+ WatchKit
18
+ WebKit )
19
+
20
+ if (NOT DEFINED SWIFT_API_NOTES_PATH )
21
+ message (FATAL_ERROR "Define SWIFT_API_NOTES_PATH before including this file" )
22
+ endif ()
23
+
24
+ foreach (module ${SWIFT_API_NOTES_INPUTS} )
25
+ if (NOT EXISTS "${SWIFT_API_NOTES_PATH} /${module} .apinotes" )
26
+ message (SEND_ERROR "Missing apinotes for ${module} " )
27
+ endif ()
28
+ endforeach ()
29
+
30
+ file (GLOB SWIFT_API_NOTES_INPUT_FILES "${SWIFT_API_NOTES_PATH} /*.apinotes" )
31
+ foreach (file ${SWIFT_API_NOTES_INPUT_FILES} )
32
+ get_filename_component (name "${file} " NAME_WE )
33
+ list (FIND SWIFT_API_NOTES_INPUTS "${name} " name_index )
34
+ if (name_index EQUAL -1 )
35
+ message (WARNING "Found apinotes for ${name} ; please add to CMakeLists.txt" )
36
+ endif ()
37
+ endforeach ()
Original file line number Diff line number Diff line change @@ -70,9 +70,8 @@ xcrun swift -apinotes -yaml-to-binary -target x64_64-apple-ios7.0 -o $SWIFT_EXEC
70
70
```
71
71
72
72
To add API notes for a system module ` $MODULE ` that does not have them yet,
73
- create a new source file ` $MODULE.apinotes ` . Newly-added API notes will require
74
- re-running CMake. Updated API notes will be found by the build system during
75
- the next build.
73
+ create a new source file ` $MODULE.apinotes ` and update CMakeLists.txt.
74
+ Updated API notes will be found by the build system during the next build.
76
75
77
76
Note that Swift provides decompilation of binary API notes files via
78
77
the ` -apinotes -binary-to-yaml ` option, which allows one to inspect
You can’t perform that action at this time.
0 commit comments