mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2025-10-28 08:31:25 +00:00
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.
This commit is contained in:
@@ -1,9 +1,18 @@
|
|||||||
cmake_minimum_required(VERSION 3.19)
|
cmake_minimum_required(VERSION 3.19)
|
||||||
cmake_policy(SET CMP0114 NEW)
|
cmake_policy(SET CMP0114 NEW)
|
||||||
cmake_policy(SET CMP0116 NEW)
|
cmake_policy(SET CMP0116 NEW)
|
||||||
|
if (POLICY CMP0147)
|
||||||
|
# Parallel build custom build steps
|
||||||
|
cmake_policy(SET CMP0147 NEW)
|
||||||
|
endif()
|
||||||
|
|
||||||
find_package(Vulkan COMPONENTS glslc REQUIRED)
|
find_package(Vulkan COMPONENTS glslc REQUIRED)
|
||||||
|
|
||||||
|
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||||
|
# Parallel build object files
|
||||||
|
add_definitions(/MP)
|
||||||
|
endif()
|
||||||
|
|
||||||
function(detect_host_compiler)
|
function(detect_host_compiler)
|
||||||
if (CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
|
if (CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
|
||||||
find_program(HOST_C_COMPILER NAMES cl gcc clang NO_CMAKE_FIND_ROOT_PATH)
|
find_program(HOST_C_COMPILER NAMES cl gcc clang NO_CMAKE_FIND_ROOT_PATH)
|
||||||
|
|||||||
Reference in New Issue
Block a user