[PATCH] D32835: [compiler-rt] [cmake] Support generic installation
Catherine Moore via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 25 16:17:47 PDT 2017
clm updated this revision to Diff 100326.
clm added a comment.
This version of the patch removes COMPILER_RT_GENERIC_BUILD and instead keys off of COMPILER_RT_LIBNAME (new) and COMPILER_RT_INSTALL_DIR. Does this look okay to install now?
Jon, thanks for the suggestion.
Catherine
https://reviews.llvm.org/D32835
Files:
CMakeLists.txt
cmake/Modules/AddCompilerRT.cmake
cmake/base-config-ix.cmake
Index: cmake/base-config-ix.cmake
===================================================================
--- cmake/base-config-ix.cmake
+++ cmake/base-config-ix.cmake
@@ -68,8 +68,10 @@
endif()
set(COMPILER_RT_LIBRARY_OUTPUT_DIR
${COMPILER_RT_OUTPUT_DIR}/lib/${COMPILER_RT_OS_DIR})
-set(COMPILER_RT_LIBRARY_INSTALL_DIR
- ${COMPILER_RT_INSTALL_PATH}/lib/${COMPILER_RT_OS_DIR})
+if (NOT COMPILER_RT_LIBRARY_INSTALL_DIR)
+ set(COMPILER_RT_LIBRARY_INSTALL_DIR
+ ${COMPILER_RT_INSTALL_PATH}/lib/${COMPILER_RT_OS_DIR})
+endif()
if(APPLE)
# On Darwin if /usr/include doesn't exist, the user probably has Xcode but not
Index: cmake/Modules/AddCompilerRT.cmake
===================================================================
--- cmake/Modules/AddCompilerRT.cmake
+++ cmake/Modules/AddCompilerRT.cmake
@@ -134,6 +134,14 @@
format_object_libs(sources_${libname} ${os} ${LIB_OBJECT_LIBS})
endif()
endforeach()
+ elseif(COMPILER_RT_LIBNAME)
+ set(libname "${name}")
+ set(output_name_${libname} ${libname}${COMPILER_RT_OS_SUFFIX})
+ message(STATUS "Setting libname to ${libname}")
+ message(STATUS "COMPILER_RT_OS_SUFFIX is ${COMPILER_RT_OS_SUFFIX}")
+ set(sources_${libname} ${LIB_SOURCES})
+ set(libnames ${libnames} ${libname})
+ set(extra_cflags_${libname} ${LIB_CFLAGS})
else()
foreach(arch ${LIB_ARCHS})
if(NOT CAN_TARGET_${arch})
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -34,6 +34,12 @@
set(COMPILER_RT_BAREMETAL_BUILD OFF CACHE BOOLEAN
"Build for a bare-metal target.")
+set(COMPILER_RT_LIBRARY_INSTALL_DIR "" CACHE PATH
+ "compiler-rt library install path")
+
+set(COMPILER_RT_LIBNAME "" CACHE STRING
+ "Customize the library installation name")
+
if (COMPILER_RT_STANDALONE_BUILD)
load_llvm_config()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32835.100326.patch
Type: text/x-patch
Size: 1915 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170525/c294bdb5/attachment.bin>
More information about the llvm-commits
mailing list