Skip to content

Commit 4afb350

Browse files
authored
Merge pull request #179 from hewj03/ocl-open-110
Apply llvm/clang patches together
2 parents 05133d9 + 532d013 commit 4afb350

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

CMakeLists.txt

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -124,20 +124,17 @@ if(NOT USE_PREBUILT_LLVM)
124124

125125
set(SPIRV_BASE_REVISION llvm_release_110)
126126
set(TARGET_BRANCH "ocl-open-110")
127-
128-
apply_patches(${LLVM_SOURCE_DIR}
129-
${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm
127+
get_filename_component(LLVM_MONOREPO_DIR ${LLVM_SOURCE_DIR} DIRECTORY)
128+
set(LLVM_PATCHES_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm
129+
${CMAKE_CURRENT_SOURCE_DIR}/patches/clang)
130+
apply_patches(${LLVM_MONOREPO_DIR}
131+
"${LLVM_PATCHES_DIRS}"
130132
${LLVM_BASE_REVISION}
131133
${TARGET_BRANCH}
132134
ret)
133135
if(${ret})
134136
add_definitions(-DAPPLIED_LLVM_PATCHES)
135137
endif()
136-
apply_patches(${CLANG_SOURCE_DIR}
137-
${CMAKE_CURRENT_SOURCE_DIR}/patches/clang
138-
${CLANG_BASE_REVISION}
139-
${TARGET_BRANCH}
140-
ret)
141138
apply_patches(${SPIRV_SOURCE_DIR}
142139
${CMAKE_CURRENT_SOURCE_DIR}/patches/spirv
143140
${SPIRV_BASE_REVISION}

cmake/modules/CMakeFunctions.cmake

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,12 @@ endmacro(use_eh)
4444
# Then all patches from the `patches_dir` are committed to the `target_branch`.
4545
# Does nothing if the `target_branch` is already checked out in the `repo_dir`.
4646
#
47-
function(apply_patches repo_dir patches_dir base_revision target_branch ret)
48-
file(GLOB patches ${patches_dir}/*.patch)
47+
function(apply_patches repo_dir patches_dirs base_revision target_branch ret)
48+
set(patches "")
49+
foreach(patches_dir ${patches_dirs})
50+
file(GLOB patches_in_dir ${patches_dir}/*.patch)
51+
list(APPEND patches ${patches_in_dir})
52+
endforeach()
4953
if(NOT patches)
5054
message(STATUS "No patches in ${patches_dir}")
5155
return()

0 commit comments

Comments
 (0)