@@ -12,93 +12,6 @@ else()
12
12
set (cmake_3_2_USES_TERMINAL USES_TERMINAL )
13
13
endif ()
14
14
15
- # Invokes llvm_config to get various configuration information needed to compile
16
- # programs which use llvm.
17
- #
18
- # Optional output parameters:
19
- # [ENABLE_ASSERTIONS enableAssertions]
20
- # If assertions are enabled.
21
- #
22
- # [TOOLS_BINARY_DIR toolsBinaryDir]
23
- # Path to llvm tools bin directory.
24
- #
25
- # [LIBRARY_DIR toolsLibDir]
26
- # Path to llvm tools lib directory.
27
- #
28
- # [INCLUDE_DIR includeDir]
29
- # Path to llvm include directory.
30
- #
31
- # [OBJ_ROOT_DIR objRootDir]
32
- # Path to llvm build tree.
33
- #
34
- # [SOURCE_DIR srcDir]
35
- # Path to llvm source tree.
36
- function (_swift_llvm_config_info )
37
- # Parse the arguments we were given.
38
- set (onevalueargs ENABLE_ASSERTIONS TOOLS_BINARY_DIR LIBRARY_DIR INCLUDE_DIR OBJ_ROOT_DIR SOURCE_DIR )
39
- cmake_parse_arguments (
40
- SWIFTLLVM
41
- "" # options
42
- "${onevalueargs} "
43
- "" # multi-value args
44
- ${ARGN} )
45
-
46
- find_program (LLVM_CONFIG "llvm-config" )
47
- if (NOT LLVM_CONFIG )
48
- message (FATAL_ERROR "llvm-config not found -- ${LLVM_CONFIG} " )
49
- endif ()
50
-
51
- set (CONFIG_OUTPUT )
52
- message (STATUS "Found LLVM_CONFIG as ${LLVM_CONFIG} " )
53
- set (CONFIG_COMMAND ${LLVM_CONFIG}
54
- "--assertion-mode"
55
- "--bindir"
56
- "--libdir"
57
- "--includedir"
58
- "--prefix"
59
- "--src-root" )
60
- execute_process (
61
- COMMAND ${CONFIG_COMMAND}
62
- RESULT_VARIABLE HAD_ERROR
63
- OUTPUT_VARIABLE CONFIG_OUTPUT
64
- )
65
- if (NOT HAD_ERROR )
66
- string (REGEX REPLACE
67
- "[ \t ]*[\r\n ]+[ \t ]*" ";"
68
- CONFIG_OUTPUT ${CONFIG_OUTPUT} )
69
- else ()
70
- string (REPLACE ";" " " CONFIG_COMMAND_STR "${CONFIG_COMMAND} " )
71
- message (STATUS "${CONFIG_COMMAND_STR} " )
72
- message (FATAL_ERROR "llvm-config failed with status ${HAD_ERROR} " )
73
- endif ()
74
-
75
- list (GET CONFIG_OUTPUT 0 ENABLE_ASSERTIONS )
76
- list (GET CONFIG_OUTPUT 1 TOOLS_BINARY_DIR )
77
- list (GET CONFIG_OUTPUT 2 LIBRARY_DIR )
78
- list (GET CONFIG_OUTPUT 3 INCLUDE_DIR )
79
- list (GET CONFIG_OUTPUT 4 LLVM_OBJ_ROOT )
80
- list (GET CONFIG_OUTPUT 5 MAIN_SRC_DIR )
81
-
82
- if (SWIFTLLVM_ENABLE_ASSERTIONS )
83
- set ("${SWIFTLLVM_ENABLE_ASSERTIONS} " "${ENABLE_ASSERTIONS} " PARENT_SCOPE )
84
- endif ()
85
- if (SWIFTLLVM_TOOLS_BINARY_DIR )
86
- set ("${SWIFTLLVM_TOOLS_BINARY_DIR} " "${TOOLS_BINARY_DIR} " PARENT_SCOPE )
87
- endif ()
88
- if (SWIFTLLVM_LIBRARY_DIR )
89
- set ("${SWIFTLLVM_LIBRARY_DIR} " "${LIBRARY_DIR} " PARENT_SCOPE )
90
- endif ()
91
- if (SWIFTLLVM_INCLUDE_DIR )
92
- set ("${SWIFTLLVM_INCLUDE_DIR} " "${INCLUDE_DIR} " PARENT_SCOPE )
93
- endif ()
94
- if (SWIFTLLVM_OBJ_ROOT_DIR )
95
- set ("${SWIFTLLVM_OBJ_ROOT_DIR} " "${LLVM_OBJ_ROOT} " PARENT_SCOPE )
96
- endif ()
97
- if (SWIFTLLVM_SOURCE_DIR )
98
- set ("${SWIFTLLVM_SOURCE_DIR} " "${MAIN_SRC_DIR} " PARENT_SCOPE )
99
- endif ()
100
- endfunction ()
101
-
102
15
# Common cmake project config for standalone builds.
103
16
#
104
17
# Parameters:
0 commit comments