Commit d13c9625 authored by Sang Ik Lee's avatar Sang Ik Lee Committed by Robert Kimball

Update clang/llvm to 5.0.2 and add macOS prebuild binary support. (#1652)

parent 74a3a354
...@@ -66,7 +66,7 @@ ExternalProject_Add( ...@@ -66,7 +66,7 @@ ExternalProject_Add(
ext_llvm ext_llvm
DEPENDS ext_clang ext_openmp DEPENDS ext_clang ext_openmp
GIT_REPOSITORY https://github.com/llvm-mirror/llvm.git GIT_REPOSITORY https://github.com/llvm-mirror/llvm.git
GIT_TAG 5ae73c34f7eca6c43e71038b06704a8f7abc7f26 GIT_TAG da4a2839d80ac52958be0129b871beedfe90136e
CMAKE_ARGS -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} CMAKE_ARGS -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_ASM_COMPILER=${LLVM_CMAKE_ASM_COMPILER} -DCMAKE_ASM_COMPILER=${LLVM_CMAKE_ASM_COMPILER}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
......
...@@ -20,11 +20,19 @@ find_package(ZLIB REQUIRED) ...@@ -20,11 +20,19 @@ find_package(ZLIB REQUIRED)
# Override default LLVM binaries # Override default LLVM binaries
if(NOT DEFINED LLVM_TARBALL_URL) if(NOT DEFINED LLVM_TARBALL_URL)
set(LLVM_TARBALL_URL http://releases.llvm.org/5.0.1/clang+llvm-5.0.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz) if(APPLE)
set(LLVM_TARBALL_URL https://releases.llvm.org/5.0.2/clang+llvm-5.0.2-x86_64-apple-darwin.tar.xz)
else()
set(LLVM_TARBALL_URL https://releases.llvm.org/5.0.2/clang+llvm-5.0.2-x86_64-linux-gnu-ubuntu-16.04.tar.xz)
endif()
endif() endif()
if(NOT DEFINED LLVM_SHA1_HASH) if(NOT DEFINED LLVM_SHA1_HASH)
set(LLVM_SHA1_HASH 2fddf9a90b182fa594786be6923e58f5ead71e9c) if(APPLE)
set(LLVM_SHA1_HASH 8c8ce5cb5e057aa6806275c3f28cd09b09f48b9b)
else()
set(LLVM_SHA1_HASH d16c7bfaa67b82042bedd5891809a608733cfc0e)
endif()
endif() endif()
# The 'BUILD_BYPRODUCTS' argument was introduced in CMake 3.2. # The 'BUILD_BYPRODUCTS' argument was introduced in CMake 3.2.
...@@ -131,11 +139,14 @@ set(LLVM_LINK_LIBS ...@@ -131,11 +139,14 @@ set(LLVM_LINK_LIBS
${SOURCE_DIR}/lib/libLLVMBinaryFormat.a ${SOURCE_DIR}/lib/libLLVMBinaryFormat.a
${SOURCE_DIR}/lib/libLLVMSupport.a ${SOURCE_DIR}/lib/libLLVMSupport.a
${SOURCE_DIR}/lib/libLLVMDemangle.a ${SOURCE_DIR}/lib/libLLVMDemangle.a
tinfo
z
m
) )
if(APPLE)
set(LLVM_LINK_LIBS ${LLVM_LINK_LIBS} curses z m)
else()
set(LLVM_LINK_LIBS ${LLVM_LINK_LIBS} tinfo z m)
endif()
add_library(libllvm INTERFACE) add_library(libllvm INTERFACE)
add_dependencies(libllvm ext_llvm) add_dependencies(libllvm ext_llvm)
target_include_directories(libllvm SYSTEM INTERFACE ${SOURCE_DIR}/include) target_include_directories(libllvm SYSTEM INTERFACE ${SOURCE_DIR}/include)
......
...@@ -30,7 +30,7 @@ get_target_property(EIGEN_INCLUDE_DIR libeigen INTERFACE_INCLUDE_DIRECTORIES) ...@@ -30,7 +30,7 @@ get_target_property(EIGEN_INCLUDE_DIR libeigen INTERFACE_INCLUDE_DIRECTORIES)
get_target_property(LLVM_LIB_DIR libllvm INTERFACE_INCLUDE_DIRECTORIES) get_target_property(LLVM_LIB_DIR libllvm INTERFACE_INCLUDE_DIRECTORIES)
# find_file(HEADER_1 cmath HINTS /usr/include/c++/7) # find_file(HEADER_1 cmath HINTS /usr/include/c++/7)
get_filename_component(LLVM_LIB_DIR ${LLVM_LIB_DIR}/../lib/clang/5.0.1/include ABSOLUTE) get_filename_component(LLVM_LIB_DIR ${LLVM_LIB_DIR}/../lib/clang/5.0.2/include ABSOLUTE)
set(HEADER_SEARCH_DEFINES set(HEADER_SEARCH_DEFINES
"EIGEN_HEADERS_PATH=\"${EIGEN_INCLUDE_DIR}\"" "EIGEN_HEADERS_PATH=\"${EIGEN_INCLUDE_DIR}\""
......
...@@ -24,7 +24,7 @@ set (SRC ...@@ -24,7 +24,7 @@ set (SRC
get_target_property(MKLDNN_INCLUDE_DIR libmkldnn INTERFACE_INCLUDE_DIRECTORIES) get_target_property(MKLDNN_INCLUDE_DIR libmkldnn INTERFACE_INCLUDE_DIRECTORIES)
get_target_property(EIGEN_INCLUDE_DIR libeigen INTERFACE_INCLUDE_DIRECTORIES) get_target_property(EIGEN_INCLUDE_DIR libeigen INTERFACE_INCLUDE_DIRECTORIES)
get_target_property(LLVM_INCLUDE_DIR libllvm INTERFACE_INCLUDE_DIRECTORIES) get_target_property(LLVM_INCLUDE_DIR libllvm INTERFACE_INCLUDE_DIRECTORIES)
set(CLANG_INCLUDE_DIR ${LLVM_INCLUDE_DIR}/../lib/clang/5.0.1/include) set(CLANG_INCLUDE_DIR ${LLVM_INCLUDE_DIR}/../lib/clang/5.0.2/include)
get_filename_component(CLANG_INCLUDE_DIR ${CLANG_INCLUDE_DIR} ABSOLUTE) get_filename_component(CLANG_INCLUDE_DIR ${CLANG_INCLUDE_DIR} ABSOLUTE)
set(HEADER_SEARCH_DEFINES set(HEADER_SEARCH_DEFINES
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment