llvm.org GIT mirror llvm / f27f188
build: extract LLVM distribution target handling This extracts the LLVM distribution target handling into a support module. Extraction will enable us to restructure the builds to support multiple distribution configurations (e.g. developer and user) to permit us to build the development package and the user package at once. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363440 91177308-0d34-0410-b5e6-96231b3b80d8 Saleem Abdulrasool a month ago
2 changed file(s) with 38 addition(s) and 30 deletion(s). Raw diff Collapse all Expand all
10671067
10681068 # This must be at the end of the LLVM root CMakeLists file because it must run
10691069 # after all targets are created.
1070 if(LLVM_DISTRIBUTION_COMPONENTS)
1071 if(LLVM_ENABLE_IDE)
1072 message(FATAL_ERROR "LLVM_DISTRIBUTION_COMPONENTS cannot be specified with multi-configuration generators (i.e. Xcode or Visual Studio)")
1073 endif()
1074
1075 add_custom_target(distribution)
1076 add_custom_target(install-distribution)
1077 add_custom_target(install-distribution-stripped)
1078 foreach(target ${LLVM_DISTRIBUTION_COMPONENTS} ${LLVM_RUNTIME_DISTRIBUTION_COMPONENTS})
1079 if(TARGET ${target})
1080 add_dependencies(distribution ${target})
1081 else()
1082 message(SEND_ERROR "Specified distribution component '${target}' doesn't have a target")
1083 endif()
1084
1085 if(TARGET install-${target})
1086 add_dependencies(install-distribution install-${target})
1087 else()
1088 message(SEND_ERROR "Specified distribution component '${target}' doesn't have an install target")
1089 endif()
1090
1091 if(TARGET install-${target}-stripped)
1092 add_dependencies(install-distribution-stripped install-${target}-stripped)
1093 else()
1094 message(SEND_ERROR "Specified distribution component '${target}' doesn't have an install-stripped target."
1095 " Its installation target creation should be changed to use add_llvm_install_targets,"
1096 " or you should manually create the 'install-${target}-stripped' target.")
1097 endif()
1098 endforeach()
1099 endif()
1070 include(LLVMDistributionSupport)
1071 llvm_distribution_add_targets()
11001072
11011073 # This allows us to deploy the Universal CRT DLLs by passing -DCMAKE_INSTALL_UCRT_LIBRARIES=ON to CMake
11021074 if (MSVC AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows" AND CMAKE_INSTALL_UCRT_LIBRARIES)
0
1 if(LLVM_DISTRIBUTION_COMPONENTS)
2 if(LLVM_ENABLE_IDE)
3 message(FATAL_ERROR "LLVM_DISTRIBUTION_COMPONENTS cannot be specified with multi-configuration generators (i.e. Xcode or Visual Studio)")
4 endif()
5 endif()
6
7 function(llvm_distribution_add_targets)
8 add_custom_target(distribution)
9 add_custom_target(install-distribution)
10 add_custom_target(install-distribution-stripped)
11
12 foreach(target ${LLVM_DISTRIBUTION_COMPONENTS}
13 ${LLVM_RUNTIME_DISTRIBUTION_COMPONENTS})
14 if(TARGET ${target})
15 add_dependencies(distribution ${target})
16 else()
17 message(SEND_ERROR "Specified distribution component '${target}' doesn't have a target")
18 endif()
19
20 if(TARGET install-${target})
21 add_dependencies(install-distribution install-${target})
22 else()
23 message(SEND_ERROR "Specified distribution component '${target}' doesn't have an install target")
24 endif()
25
26 if(TARGET install-${target}-stripped)
27 add_dependencies(install-distribution-stripped install-${target}-stripped)
28 else()
29 message(SEND_ERROR
30 "Specified distribution component '${target}' doesn't have an install-stripped target."
31 " Its installation target creation should be changed to use add_llvm_install_targets,"
32 " or you should manually create the 'install-${target}-stripped' target.")
33 endif()
34 endforeach()
35 endfunction()