@@ -142,8 +142,15 @@ if (NOT DEFINED BOOST_MP11_SOURCE_DIR)
142
142
GIT_REPOSITORY ${BOOST_MP11_GIT_REPO}
143
143
GIT_TAG ${BOOST_MP11_GIT_TAG}
144
144
)
145
- FetchContent_MakeAvailable (boost_mp11 )
146
145
FetchContent_GetProperties (boost_mp11 )
146
+
147
+ # Avoid FetchContent_MakeAvailable, as we just want to download sources,
148
+ # and not to import mp11's cmake files into build.
149
+ if (NOT boost_mp11_POPULATED )
150
+ FetchContent_Populate (boost_mp11 )
151
+ set (boost_mp11_POPULATED TRUE )
152
+ endif (NOT boost_mp11_POPULATED )
153
+
147
154
set (BOOST_MP11_SOURCE_DIR ${boost_mp11_SOURCE_DIR} )
148
155
message (STATUS "BOOST_MP11_SOURCE_DIR not set, downloading boost/mp11 headers from ${BOOST_MP11_GIT_REPO} " )
149
156
set (BOOST_MP11_SRC_PATH ${BOOST_MP11_GIT_REPO} )
@@ -161,11 +168,15 @@ set(BOOST_MP11_DESTINATION_DIR ${SYCL_INCLUDE_BUILD_DIR}/sycl/detail/boost)
161
168
string (REPLACE "${BOOST_MP11_SOURCE_DIR} /include/boost" "${BOOST_MP11_DESTINATION_DIR} "
162
169
OUT_HEADERS_BOOST_MP11 "${HEADERS_BOOST_MP11} " )
163
170
171
+ # The target which produces preprocessed boost/mp11 headers
172
+ add_custom_target (boost_mp11-headers
173
+ DEPENDS ${OUT_HEADERS_BOOST_MP11} )
174
+
164
175
# Run preprocessing on each header, output result into
165
176
# ${BOOST_MP11_DESTINATION_DIR}
166
177
add_custom_command (
167
178
OUTPUT ${OUT_HEADERS_BOOST_MP11}
168
- DEPENDS boost_mp11
179
+ DEPENDS ${HEADERS_BOOST_MP11}
169
180
COMMAND ${CMAKE_COMMAND}
170
181
-DIN=${BOOST_MP11_SOURCE_DIR}/include/boost
171
182
-DOUT=${BOOST_MP11_DESTINATION_DIR}
@@ -174,10 +185,6 @@ add_custom_command(
174
185
-P ${CMAKE_CURRENT_SOURCE_DIR} /cmake/modules/pp_boost_mp11_headers.cmake
175
186
COMMENT "Preprocessing boost/mp11 headers ${BOOST_MP11_SOURCE_DIR} /include/boost -> ${BOOST_MP11_DESTINATION_DIR} ..." )
176
187
177
- # The target which produces preprocessed boost/mp11 headers
178
- add_custom_target (boost_mp11-headers
179
- DEPENDS ${OUT_HEADERS_BOOST_MP11} )
180
-
181
188
# -------------- end boost/mp11 headers import and preprocessing
182
189
183
190
option (SYCL_BUILD_PI_CUDA
@@ -209,7 +216,8 @@ string(REPLACE "${sycl_inc_dir}/CL" "${SYCL_INCLUDE_BUILD_DIR}/sycl/CL"
209
216
# Copy SYCL headers from sources to build directory
210
217
add_custom_target (sycl-headers
211
218
DEPENDS ${OUT_HEADERS_IN_SYCL_DIR}
212
- ${OUT_HEADERS_IN_CL_DIR} )
219
+ ${OUT_HEADERS_IN_CL_DIR}
220
+ boost_mp11-headers )
213
221
214
222
add_custom_command (
215
223
OUTPUT ${OUT_HEADERS_IN_SYCL_DIR}
0 commit comments