Skip to content

Commit f9c5c45

Browse files
committed
[build] Merge Clang's features.json from binary directory, handle values
1 parent 5b77b32 commit f9c5c45

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

lib/Option/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ target_link_libraries(swiftOption PRIVATE
88

99
set(features_merger "${SWIFT_SOURCE_DIR}/utils/merge-features.py")
1010
set(features_file_swift_src "${CMAKE_CURRENT_SOURCE_DIR}/features.json")
11-
set(features_file_clang_src "${LLVM_MAIN_SRC_DIR}/../clang/tools/driver/features.json")
11+
set(features_file_clang_src "${LLVM_BINARY_DIR}/share/clang/features.json")
1212
set(features_file_dest "${CMAKE_BINARY_DIR}/share/swift/features.json")
1313

1414
add_custom_command(

utils/merge-features.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,12 @@ def read_features(from_file, add_prefix):
5252
if "name" not in feature:
5353
invalid_file(from_file, "missing name in features list")
5454

55-
features.append({"name": add_prefix + feature["name"]})
55+
new_feature = {"name": add_prefix + feature["name"]}
56+
57+
if "value" in feature:
58+
new_feature.update({"value" : feature["value"]})
59+
60+
features.append(new_feature)
5661
return features
5762

5863

0 commit comments

Comments
 (0)