@@ -12,6 +12,25 @@ else()
12
12
set (cmake_3_2_USES_TERMINAL USES_TERMINAL )
13
13
endif ()
14
14
15
+ macro (swift_common_standalone_build_config_cmark product )
16
+ set (${product} _PATH_TO_CMARK_SOURCE "${${product} _PATH_TO_CMARK_SOURCE}"
17
+ CACHE PATH "Path to CMark source code." )
18
+ set (${product} _PATH_TO_CMARK_BUILD "${${product} _PATH_TO_CMARK_BUILD}"
19
+ CACHE PATH "Path to the directory where CMark was built." )
20
+ set (${product} _CMARK_LIBRARY_DIR "${${product} _CMARK_LIBRARY_DIR}" CACHE PATH
21
+ "Path to the directory where CMark was installed." )
22
+ get_filename_component (PATH_TO_CMARK_BUILD "${${product} _PATH_TO_CMARK_BUILD}"
23
+ ABSOLUTE )
24
+ get_filename_component (CMARK_MAIN_SRC_DIR "${${product} _PATH_TO_CMARK_SOURCE}"
25
+ ABSOLUTE )
26
+ get_filename_component (CMARK_LIBRARY_DIR "${${product} _CMARK_LIBRARY_DIR}"
27
+ ABSOLUTE )
28
+ set (CMARK_MAIN_INCLUDE_DIR "${CMARK_MAIN_SRC_DIR} /src" )
29
+ set (CMARK_BUILD_INCLUDE_DIR "${PATH_TO_CMARK_BUILD} /src" )
30
+ include_directories ("${CMARK_MAIN_INCLUDE_DIR} "
31
+ "${CMARK_BUILD_INCLUDE_DIR} " )
32
+ endmacro ()
33
+
15
34
# Common cmake project config for standalone builds.
16
35
#
17
36
# Parameters:
@@ -74,19 +93,6 @@ macro(swift_common_standalone_build_config product is_cross_compiling)
74
93
set (${product} _PATH_TO_CLANG_BUILD "${PATH_TO_LLVM_BUILD} " CACHE PATH
75
94
"Path to the directory where Clang was built or installed." )
76
95
77
- set (${product} _PATH_TO_CMARK_SOURCE "${${product} _PATH_TO_CMARK_SOURCE}"
78
- CACHE PATH "Path to CMark source code." )
79
- set (${product} _PATH_TO_CMARK_BUILD "${${product} _PATH_TO_CMARK_BUILD}"
80
- CACHE PATH "Path to the directory where CMark was built." )
81
- set (${product} _CMARK_LIBRARY_DIR "${${product} _CMARK_LIBRARY_DIR}" CACHE PATH
82
- "Path to the directory where CMark was installed." )
83
- get_filename_component (PATH_TO_CMARK_BUILD "${${product} _PATH_TO_CMARK_BUILD}"
84
- ABSOLUTE )
85
- get_filename_component (CMARK_MAIN_SRC_DIR "${${product} _PATH_TO_CMARK_SOURCE}"
86
- ABSOLUTE )
87
- get_filename_component (CMARK_LIBRARY_DIR "${${product} _CMARK_LIBRARY_DIR}"
88
- ABSOLUTE )
89
-
90
96
if (NOT EXISTS "${${product} _PATH_TO_CLANG_SOURCE}/include/clang/AST/Decl.h" )
91
97
message (FATAL_ERROR "Please set ${product} _PATH_TO_CLANG_SOURCE to the root directory of Clang's source code." )
92
98
else ()
@@ -133,16 +139,12 @@ macro(swift_common_standalone_build_config product is_cross_compiling)
133
139
"Version number that will be placed into the libclang library , in the form XX.YY" )
134
140
135
141
set (CLANG_MAIN_INCLUDE_DIR "${CLANG_MAIN_SRC_DIR} /include" )
136
- set (CMARK_MAIN_INCLUDE_DIR "${CMARK_MAIN_SRC_DIR} /src" )
137
- set (CMARK_BUILD_INCLUDE_DIR "${PATH_TO_CMARK_BUILD} /src" )
138
142
139
143
set (CMAKE_INCLUDE_CURRENT_DIR ON )
140
144
include_directories ("${PATH_TO_LLVM_BUILD} /include"
141
145
"${LLVM_MAIN_INCLUDE_DIR} "
142
146
"${CLANG_BUILD_INCLUDE_DIR} "
143
- "${CLANG_MAIN_INCLUDE_DIR} "
144
- "${CMARK_MAIN_INCLUDE_DIR} "
145
- "${CMARK_BUILD_INCLUDE_DIR} " )
147
+ "${CLANG_MAIN_INCLUDE_DIR} " )
146
148
foreach (INCLUDE_DIR ${LLVM_INCLUDE_DIRS} )
147
149
include_directories (${INCLUDE_DIR} )
148
150
endforeach ()
@@ -168,6 +170,8 @@ macro(swift_common_standalone_build_config product is_cross_compiling)
168
170
if (LLVM_ENABLE_DOXYGEN )
169
171
find_package (Doxygen REQUIRED )
170
172
endif ()
173
+
174
+ swift_common_standalone_build_config_cmark (${product} )
171
175
endmacro ()
172
176
173
177
# Common cmake project config for unified builds.
0 commit comments