Skip to content

Commit 75b6941

Browse files
committed
Add option to control patch apply.
1 parent 58f0c62 commit 75b6941

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

CMakeLists.txt

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -152,14 +152,20 @@ if(NOT USE_PREBUILT_LLVM)
152152
get_filename_component(LLVM_MONOREPO_DIR ${LLVM_SOURCE_DIR} DIRECTORY)
153153
set(LLVM_PATCHES_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm
154154
${CMAKE_CURRENT_SOURCE_DIR}/patches/clang)
155-
apply_patches(${LLVM_MONOREPO_DIR}
156-
"${LLVM_PATCHES_DIRS}"
157-
${LLVM_BASE_REVISION}
158-
${TARGET_BRANCH})
159-
apply_patches(${SPIRV_SOURCE_DIR}
160-
${CMAKE_CURRENT_SOURCE_DIR}/patches/spirv
161-
${SPIRV_BASE_REVISION}
162-
${TARGET_BRANCH})
155+
option(APPLY_PATCHES "option to apply patches" ON)
156+
if(APPLY_PATCHES)
157+
message(STATUS "APPLY_PATCHES is enabled.")
158+
apply_patches(${LLVM_MONOREPO_DIR}
159+
"${LLVM_PATCHES_DIRS}"
160+
${LLVM_BASE_REVISION}
161+
${TARGET_BRANCH})
162+
apply_patches(${SPIRV_SOURCE_DIR}
163+
${CMAKE_CURRENT_SOURCE_DIR}/patches/spirv
164+
${SPIRV_BASE_REVISION}
165+
${TARGET_BRANCH})
166+
else()
167+
message(STATUS "APPLY_PATCHES is disabled, skip patch apply process.")
168+
endif()
163169
endif(NOT USE_PREBUILT_LLVM)
164170

165171
#

0 commit comments

Comments
 (0)