Index: CMakeLists.txt =================================================================== --- CMakeLists.txt +++ CMakeLists.txt @@ -190,6 +190,8 @@ option(LLVM_INSTALL_TOOLCHAIN_ONLY "Only include toolchain files in the 'install' target." OFF) +option(LLVM_INSTALL_STRIPPED_BINARIES "Instruct cmake to strip binaries during installation" OFF) + option(LLVM_USE_FOLDERS "Enable solution folders in Visual Studio. Disable for Express versions." ON) if ( LLVM_USE_FOLDERS ) set_property(GLOBAL PROPERTY USE_FOLDERS ON) @@ -979,6 +981,7 @@ DEPENDS llvm-headers COMMAND "${CMAKE_COMMAND}" -DCMAKE_INSTALL_COMPONENT=llvm-headers + -DCMAKE_INSTALL_DO_STRIP=${LLVM_INSTALL_STRIPPED_BINARIES} -P "${CMAKE_BINARY_DIR}/cmake_install.cmake") endif() endif() Index: cmake/modules/AddLLVM.cmake =================================================================== --- cmake/modules/AddLLVM.cmake +++ cmake/modules/AddLLVM.cmake @@ -623,6 +623,7 @@ DEPENDS ${name} COMMAND "${CMAKE_COMMAND}" -DCMAKE_INSTALL_COMPONENT=${name} + -DCMAKE_INSTALL_DO_STRIP=${LLVM_INSTALL_STRIPPED_BINARIES} -P "${CMAKE_BINARY_DIR}/cmake_install.cmake") endif() endif() @@ -853,6 +854,7 @@ DEPENDS ${name} COMMAND "${CMAKE_COMMAND}" -DCMAKE_INSTALL_COMPONENT=${name} + -DCMAKE_INSTALL_DO_STRIP=${LLVM_INSTALL_STRIPPED_BINARIES} -P "${CMAKE_BINARY_DIR}/cmake_install.cmake") endif() endif() @@ -893,6 +895,7 @@ DEPENDS ${name} COMMAND "${CMAKE_COMMAND}" -DCMAKE_INSTALL_COMPONENT=${name} + -DCMAKE_INSTALL_DO_STRIP=${LLVM_INSTALL_STRIPPED_BINARIES} -P "${CMAKE_BINARY_DIR}/cmake_install.cmake") endif() endif() @@ -1404,6 +1407,7 @@ DEPENDS ${name} ${dest} install-${dest} COMMAND "${CMAKE_COMMAND}" -DCMAKE_INSTALL_COMPONENT=${name} + -DCMAKE_INSTALL_DO_STRIP=${LLVM_INSTALL_STRIPPED_BINARIES} -P "${CMAKE_BINARY_DIR}/cmake_install.cmake") endif() endfunction() @@ -1439,6 +1443,7 @@ DEPENDS ${name} ${dest} install-${dest} COMMAND "${CMAKE_COMMAND}" -DCMAKE_INSTALL_COMPONENT=${name} + -DCMAKE_INSTALL_DO_STRIP=${LLVM_INSTALL_STRIPPED_BINARIES} -P "${CMAKE_BINARY_DIR}/cmake_install.cmake") endif() endfunction() Index: cmake/modules/CMakeLists.txt =================================================================== --- cmake/modules/CMakeLists.txt +++ cmake/modules/CMakeLists.txt @@ -132,6 +132,7 @@ add_custom_target(install-cmake-exports COMMAND "${CMAKE_COMMAND}" -DCMAKE_INSTALL_COMPONENT=cmake-exports + -DCMAKE_INSTALL_DO_STRIP=${LLVM_INSTALL_STRIPPED_BINARIES} -P "${CMAKE_BINARY_DIR}/cmake_install.cmake") endif() endif() Index: cmake/modules/LLVMExternalProjectUtils.cmake =================================================================== --- cmake/modules/LLVMExternalProjectUtils.cmake +++ cmake/modules/LLVMExternalProjectUtils.cmake @@ -193,6 +193,7 @@ DEPENDS ${name} COMMAND "${CMAKE_COMMAND}" -DCMAKE_INSTALL_COMPONENT=${name} + -DCMAKE_INSTALL_DO_STRIP=${LLVM_INSTALL_STRIPPED_BINARIES} -P "${CMAKE_BINARY_DIR}/cmake_install.cmake" USES_TERMINAL) endif() Index: docs/CMake.rst =================================================================== --- docs/CMake.rst +++ docs/CMake.rst @@ -228,6 +228,9 @@ Install symlinks from the binutils tool names to the corresponding LLVM tools. For example, ar will be symlinked to llvm-ar. +**LLVM_INSTALL_STRIPPED_BINARIES**:BOOL + Instruct cmake to strip binaries during installation. + **LLVM_BUILD_EXAMPLES**:BOOL Build LLVM examples. Defaults to OFF. Targets for building each example are generated in any case. See documentation for *LLVM_BUILD_TOOLS* above for more Index: tools/xcode-toolchain/CMakeLists.txt =================================================================== --- tools/xcode-toolchain/CMakeLists.txt +++ tools/xcode-toolchain/CMakeLists.txt @@ -97,6 +97,7 @@ DEPENDS ${LLVMToolchainDir}/Info.plist COMMAND "${CMAKE_COMMAND}" --build ${CMAKE_BINARY_DIR} --target all COMMAND "${CMAKE_COMMAND}" + -DCMAKE_INSTALL_DO_STRIP=${LLVM_INSTALL_STRIPPED_BINARIES} -DCMAKE_INSTALL_PREFIX=${LLVMToolchainDir}/usr/ -P "${CMAKE_BINARY_DIR}/cmake_install.cmake" USES_TERMINAL) @@ -114,6 +115,7 @@ DEPENDS ${target} COMMAND "${CMAKE_COMMAND}" -DCMAKE_INSTALL_COMPONENT=${target} + -DCMAKE_INSTALL_DO_STRIP=${LLVM_INSTALL_STRIPPED_BINARIES} -DCMAKE_INSTALL_PREFIX=${LLVMToolchainDir}/usr/ -P "${CMAKE_BINARY_DIR}/cmake_install.cmake" USES_TERMINAL)