Skip to content

Commit 7ea15bb

Browse files
authored
vulkan: Improve build time for MSVC (#16545)
Enable CMP0147 so custom build steps (invoking vulkan-shader-gen) are run in parallel. Enable /MP so source files are compiled in parallel.
1 parent 9c7185d commit 7ea15bb

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

ggml/src/ggml-vulkan/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
cmake_minimum_required(VERSION 3.19)
22
cmake_policy(SET CMP0114 NEW)
33
cmake_policy(SET CMP0116 NEW)
4+
if (POLICY CMP0147)
5+
# Parallel build custom build steps
6+
cmake_policy(SET CMP0147 NEW)
7+
endif()
48

59
find_package(Vulkan COMPONENTS glslc REQUIRED)
610

11+
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
12+
# Parallel build object files
13+
add_definitions(/MP)
14+
endif()
15+
716
function(detect_host_compiler)
817
if (CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
918
find_program(HOST_C_COMPILER NAMES cl gcc clang NO_CMAKE_FIND_ROOT_PATH)

0 commit comments

Comments
 (0)