Skip to content

Commit

Permalink
[CMake/build-presets] Add 'clang-libclang' install component that ins…
Browse files Browse the repository at this point in the history
…talls libclang and pass the clang version via darwin-llvm-submit-version.

rdar://22907181

Swift SVN r32707
  • Loading branch information
akyrtzi committed Oct 15, 2015
1 parent 711c76e commit f3b8a58
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ set(SWIFT_ENABLE_GOLD_LINKER FALSE CACHE BOOL
"Enable using the gold linker when available")

set(_SWIFT_KNOWN_INSTALL_COMPONENTS
"compiler;clang-builtin-headers;clang-resource-dir-symlink;clang-builtin-headers-in-clang-resource-dir;arclite-symlink;stdlib;stdlib-experimental;sdk-overlay;editor-integration;lang-docs;tools;testsuite-tools;dev")
"compiler;clang-builtin-headers;clang-resource-dir-symlink;clang-builtin-headers-in-clang-resource-dir;clang-libclang;arclite-symlink;stdlib;stdlib-experimental;sdk-overlay;editor-integration;lang-docs;tools;testsuite-tools;dev")

# Set the SWIFT_INSTALL_COMPONENTS variable to the default value if it is not passed in via -D
set(SWIFT_INSTALL_COMPONENTS "${_SWIFT_KNOWN_INSTALL_COMPONENTS}" CACHE STRING
Expand Down Expand Up @@ -585,6 +585,11 @@ if(SWIFT_INCLUDE_DOCS)
add_subdirectory(docs)
endif()

swift_install_in_component(clang-libclang
FILES "${LLVM_LIBRARY_OUTPUT_INTDIR}/libclang.dylib"
"${LLVM_LIBRARY_OUTPUT_INTDIR}/libclang.${SWIFT_LIBCLANG_LIBRARY_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}"
DESTINATION "lib")

# Add a documentation target so that documentation shows up in the
# Xcode project.
if(XCODE)
Expand Down
8 changes: 8 additions & 0 deletions cmake/modules/SwiftSharedCMakeConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,14 @@ macro(swift_common_standalone_build_config product is_cross_compiling)
include(HandleLLVMOptions)

set(PACKAGE_VERSION "${LLVM_PACKAGE_VERSION}")
string(REGEX REPLACE "([0-9]+)\\.[0-9]+(\\.[0-9]+)?" "\\1" PACKAGE_VERSION_MAJOR
${PACKAGE_VERSION})
string(REGEX REPLACE "[0-9]+\\.([0-9]+)(\\.[0-9]+)?" "\\1" PACKAGE_VERSION_MINOR
${PACKAGE_VERSION})

set(SWIFT_LIBCLANG_LIBRARY_VERSION
"${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}" CACHE STRING
"Version number that will be placed into the libclang library , in the form XX.YY")

set(LLVM_MAIN_INCLUDE_DIR "${LLVM_MAIN_SRC_DIR}/include")
set(CLANG_MAIN_INCLUDE_DIR "${CLANG_MAIN_SRC_DIR}/include")
Expand Down

0 comments on commit f3b8a58

Please sign in to comment.