Skip to content

Commit 8395e35

Browse files
committed
SourceKit: micro-optimization of CMake (NFC)
Set all the target properties in a single shot. This avoids the multiple string parsing within CMake. Although this makes no noticable differnce, it is slightly more efficient and also colocates all the target properties.
1 parent cc91643 commit 8395e35

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

tools/SourceKit/cmake/modules/AddSwiftSourceKit.cmake

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -335,31 +335,33 @@ macro(add_sourcekit_framework name)
335335
LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
336336
ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}
337337
RUNTIME DESTINATION bin)
338-
set_target_properties(${name} PROPERTIES FOLDER "SourceKit frameworks")
339338
set_output_directory(${name}
340339
BINARY_DIR ${SOURCEKIT_RUNTIME_OUTPUT_INTDIR}
341340
LIBRARY_DIR ${SOURCEKIT_LIBRARY_OUTPUT_INTDIR})
342-
set_target_properties(${name} PROPERTIES FRAMEWORK TRUE)
343-
set_target_properties(${name} PROPERTIES PUBLIC_HEADER "${headers}")
344-
set_target_properties(${name} PROPERTIES MACOSX_FRAMEWORK_INFO_PLIST "${SOURCEKIT_SOURCE_DIR}/cmake/MacOSXFrameworkInfo.plist.in")
345-
set_target_properties(${name} PROPERTIES MACOSX_FRAMEWORK_IDENTIFIER "com.apple.${name}")
346-
set_target_properties(${name} PROPERTIES MACOSX_FRAMEWORK_SHORT_VERSION_STRING "1.0")
347-
set_target_properties(${name} PROPERTIES MACOSX_FRAMEWORK_BUNDLE_VERSION "${SOURCEKIT_VERSION_STRING}")
348-
set_target_properties(${name} PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE)
349-
set_target_properties(${name} PROPERTIES INSTALL_NAME_DIR "@rpath")
341+
set_target_properties(${name} PROPERTIES
342+
BUILD_WITH_INSTALL_RPATH TRUE
343+
FOLDER "SourceKit frameworks"
344+
FRAMEWORK TRUE
345+
INSTALL_NAME_DIR "@rpath"
346+
MACOSX_FRAMEWORK_INFO_PLIST "${SOURCEKIT_SOURCE_DIR}/cmake/MacOSXFrameworkInfo.plist.in"
347+
MACOSX_FRAMEWORK_IDENTIFIER "com.apple.${name}"
348+
MACOSX_FRAMEWORK_SHORT_VERSION_STRING "1.0"
349+
MACOSX_FRAMEWORK_BUNDLE_VERSION "${SOURCEKIT_VERSION_STRING}"
350+
PUBLIC_HEADER "${headers}")
350351
else()
351352
swift_install_in_component(${SOURCEKITFW_INSTALL_IN_COMPONENT}
352353
DIRECTORY ${framework_location}
353354
DESTINATION lib${LLVM_LIBDIR_SUFFIX}
354355
USE_SOURCE_PERMISSIONS)
355-
set_target_properties(${name} PROPERTIES FOLDER "SourceKit frameworks")
356356
set_output_directory(${name}
357357
BINARY_DIR ${framework_location}
358358
LIBRARY_DIR ${framework_location})
359-
set_target_properties(${name} PROPERTIES PREFIX "")
360-
set_target_properties(${name} PROPERTIES SUFFIX "")
361-
set_target_properties(${name} PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE)
362-
set_target_properties(${name} PROPERTIES INSTALL_NAME_DIR "@rpath/${name}.framework")
359+
set_target_properties(${name} PROPERTIES
360+
BUILD_WITH_INSTALL_RPATH TRUE
361+
FOLDER "SourceKit frameworks"
362+
INSTALL_NAME_DIR "@rpath/${name}.framework"
363+
PREFIX ""
364+
SUFFIX "")
363365

364366
foreach(hdr ${headers})
365367
get_filename_component(hdrname ${hdr} NAME)

0 commit comments

Comments
 (0)