1
- #
2
- # Copyright (c) 2017, Intel Corporation
1
+ #===================== begin_copyright_notice ==================================
3
2
#
4
- # Permission is hereby granted, free of charge, to any person obtaining a
5
- # copy of this software and associated documentation files (the "Software"),
6
- # to deal in the Software without restriction, including without limitation
7
- # the rights to use, copy, modify, merge, publish, distribute, sublicense,
8
- # and/or sell copies of the Software, and to permit persons to whom the
9
- # Software is furnished to do so, subject to the following conditions:
3
+ # Copyright (c) 2017-2018 Intel Corporation.
10
4
#
11
- # The above copyright notice and this permission notice shall be included
12
- # in all copies or substantial portions of the Software.
5
+ # Permission is hereby granted, free of charge, to any person obtaining a
6
+ # copy of this software and associated documentation files (the
7
+ # "Software"), to deal in the Software without restriction, including
8
+ # without limitation the rights to use, copy, modify, merge, publish,
9
+ # distribute, sublicense, and/or sell copies of the Software, and to
10
+ # permit persons to whom the Software is furnished to do so, subject to
11
+ # the following conditions:
13
12
#
14
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15
- # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17
- # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
18
- # OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19
- # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20
- # OTHER DEALINGS IN THE SOFTWARE.
21
- #
13
+ # The above copyright notice and this permission notice shall be included
14
+ # in all copies or substantial portions of the Software.
15
+ #
16
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17
+ # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
+ # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
+ # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
+ #
24
+ #
25
+ # ======================= end_copyright_notice ==================================
22
26
23
27
#
24
28
# LLVM libraries
@@ -35,20 +39,21 @@ function(add_dependencies_for_llvm_lib_target llvm_src_dir)
35
39
if (llvm_sub_targets)
36
40
foreach (llvm_target IN LISTS llvm_sub_targets)
37
41
add_dependencies (${LLVM_LIB_NAME} ${llvm_target} )
42
+ set_target_properties (${llvm_target} PROPERTIES VS_PRE_DEFAULT_PROPS "${CMAKE_CURRENT_SOURCE_DIR} /../../WrkSpace/PropertySheets/igfx_env.props" )
38
43
endforeach ()
39
44
endif ()
40
45
endfunction ()
41
46
42
47
if (BS_USE_OSDM_BUILD_SYSTEM)
43
48
include (${BUILD_SYS_INC} /utils.cmake)
44
49
bs_find_patch()
45
- bs_find_python ()
50
+ bs_find_python2 ()
46
51
else ()
47
52
if (NOT PATCH)
48
53
find_program (PATCH NAMES patch patch.exe)
49
54
endif ()
50
55
if (NOT PYTHON)
51
- find_program (PYTHON NAMES python python.exe)
56
+ find_program (PYTHON NAMES python2 python python2.exe python.exe)
52
57
endif ()
53
58
endif ()
54
59
@@ -153,6 +158,7 @@ if(LLVM_APPLY_PATCHES)
153
158
# Customization patches will be applied if present.
154
159
file (GLOB LLVM_EXTERNAL_PATCH_FILES "${CMAKE_CURRENT_SOURCE_DIR} /releases/4.0.0/patches_external/*.patch" )
155
160
list (APPEND LLVM_PATCH_FILES ${LLVM_EXTERNAL_PATCH_FILES} )
161
+ set (LLVM_APPLY_INTERNAL_PATCHES true )
156
162
if (LLVM_APPLY_INTERNAL_PATCHES)
157
163
file (GLOB LLVM_INTERNAL_PATCH_FILES "${CMAKE_CURRENT_SOURCE_DIR} /releases/4.0.0/patches_internal/*.patch" )
158
164
list (APPEND LLVM_PATCH_FILES ${LLVM_INTERNAL_PATCH_FILES} )
@@ -170,13 +176,10 @@ set(LLVM_DIR ${LLVM_DIR} PARENT_SCOPE)
170
176
set (LLVM_LIB_NAME ${LLVM_LIB_NAME} PARENT_SCOPE)
171
177
172
178
message (STATUS "LLVM_LIB_NAME = ${LLVM_LIB_NAME} " )
173
- message (STATUS "LLVM_BUILD_TYPE = ${CMAKE_BUILD_TYPE} " )
174
179
message (STATUS "LLVM_SOURCE_URL = ${LLVM_SOURCE_URL} " )
175
180
message (STATUS "LLVM_DIR = ${LLVM_DIR} " )
176
181
message (STATUS "LLVM_OPTIONS = ${LLVM_OPTIONS} " )
177
182
178
- include (${CMAKE_ROOT} /Modules/ExternalProject.cmake)
179
-
180
183
if (LLVM_USE_SOURCES_DIRECTLY)
181
184
set (LLVM_SOURCE_DIR "${CMAKE_BINARY_DIR} /llvm/src" )
182
185
if (NOT EXISTS ${LLVM_SOURCE_DIR} )
@@ -205,40 +208,57 @@ if(LLVM_USE_SOURCES_DIRECTLY)
205
208
endif ()
206
209
endforeach ()
207
210
endif ()
208
-
209
- set (CMAKE_INSTALL_PREFIX ${LLVM_DIR} )
210
- add_subdirectory (${LLVM_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} /src)
211
+
212
+ if (CMAKE_CONFIGURATION_TYPES )
213
+ # Multi-configuration generator.
214
+ set (CMAKE_CONFIGURATION_TYPES "Debug" "Release" "ReleaseInternal" )
215
+ message (STATUS "LLVM_CONFIGURATION_TYPES = ${CMAKE_CONFIGURATION_TYPES} " )
216
+ else ()
217
+ # Single-configuration generator.
218
+ message (STATUS "LLVM_BUILD_TYPE = ${CMAKE_BUILD_TYPE} " )
219
+ endif ()
220
+
221
+ add_subdirectory (${LLVM_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} /src)
211
222
add_custom_target (${LLVM_LIB_NAME} ALL )
223
+ set_target_properties (${LLVM_LIB_NAME} PROPERTIES VS_PRE_DEFAULT_PROPS "${CMAKE_CURRENT_SOURCE_DIR} /../../WrkSpace/PropertySheets/igfx_env.props" )
212
224
add_custom_command (TARGET ${LLVM_LIB_NAME}
213
- COMMAND ${CMAKE_COMMAND} -DCMAKE_INSTALL_CONFIG_NAME=$<$<CONFIG:Debug>:Debug>$<$<CONFIG:Release>:Release>$<$<CONFIG:ReleaseInternal>:ReleaseInternal> -P cmake_install.cmake
225
+ COMMAND ${CMAKE_COMMAND}
226
+ -DCMAKE_INSTALL_CONFIG_NAME=$<CONFIG>
227
+ -DCMAKE_INSTALL_PREFIX=${LLVM_DIR}
228
+ -P cmake_install.cmake
214
229
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} /src)
215
230
add_dependencies_for_llvm_lib_target(${LLVM_SOURCE_DIR} )
216
231
else ()
217
- ExternalProject_Add(${LLVM_LIB_NAME}
218
- URL ${LLVM_SOURCE_URL}
219
- PREFIX src
220
- BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR} /src
221
- CMAKE_ARGS -G ${CMAKE_GENERATOR}
222
- -DCMAKE_BUILD_TYPE=$<$<CONFIG:Debug>:Debug>$<$<CONFIG:Release>:Release>$<$<CONFIG:ReleaseInternal>:Release>
223
- -DCMAKE_INSTALL_PREFIX=${LLVM_DIR}
224
- ${LLVM_OPTIONS}
225
- INSTALL_COMMAND DESTDIR= ${CMAKE_COMMAND} --build . --target install
226
- )
227
- # Apply customization patches if any.
228
- set (i 1)
229
- set (patch_dependee "patch" )
230
- foreach (patch_file ${LLVM_PATCH_FILES} )
231
-
232
- ExternalProject_Add_Step(${LLVM_LIB_NAME} "patch${i} "
233
- COMMAND ${PATCH} -d "${CMAKE_CURRENT_BINARY_DIR} /src/src/${LLVM_LIB_NAME} " -p1 < ${patch_file}
234
- DEPENDEES ${patch_dependee}
235
- DEPENDERS configure
236
- COMMENT "Apply ${patch_file} file"
237
- )
238
-
239
- set (patch_dependee "patch${i} " )
240
- math (EXPR i "${i} + 1" )
241
-
242
- endforeach ()
232
+
233
+ message (STATUS "LLVM_BUILD_TYPE = ${CMAKE_BUILD_TYPE} " )
234
+
235
+ include (${CMAKE_ROOT} /Modules/ExternalProject.cmake)
236
+
237
+ ExternalProject_Add(${LLVM_LIB_NAME}
238
+ URL ${LLVM_SOURCE_URL}
239
+ PREFIX src
240
+ BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR} /src
241
+ CMAKE_ARGS -G ${CMAKE_GENERATOR}
242
+ -DCMAKE_BUILD_TYPE=$<$<CONFIG:Debug>:Debug>$<$<CONFIG:Release>:Release>$<$<CONFIG:ReleaseInternal>:Release>
243
+ -DCMAKE_INSTALL_PREFIX=${LLVM_DIR}
244
+ ${LLVM_OPTIONS}
245
+ INSTALL_COMMAND DESTDIR= ${CMAKE_COMMAND} --build . --target install
246
+ )
247
+ # Apply customization patches if any.
248
+ set (i 1)
249
+ set (patch_dependee "patch" )
250
+ foreach (patch_file ${LLVM_PATCH_FILES} )
251
+
252
+ ExternalProject_Add_Step(${LLVM_LIB_NAME} "patch${i} "
253
+ COMMAND ${PATCH} -d "${CMAKE_CURRENT_BINARY_DIR} /src/src/${LLVM_LIB_NAME} " -p1 < ${patch_file}
254
+ DEPENDEES ${patch_dependee}
255
+ DEPENDERS configure
256
+ COMMENT "Apply ${patch_file} file"
257
+ )
258
+
259
+ set (patch_dependee "patch${i} " )
260
+ math (EXPR i "${i} + 1" )
261
+
262
+ endforeach ()
243
263
endif ()
244
264
0 commit comments