Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
cmake_minimum_required(VERSION 3.14...3.28) # for add_link_options and implicit target directories.
project("llama.cpp" C CXX)

# Only call project() when llama.cpp is the top-level build. When consumed as
# a subdirectory, a second project() would re-run toolchain detection and can
# override parent-project settings. See:
# https://github.com/ggml-org/llama.cpp/issues/20415
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
project("llama.cpp" C CXX)
endif()

include(CheckIncludeFileCXX)

#set(CMAKE_WARN_DEPRECATED YES)
Expand Down
11 changes: 10 additions & 1 deletion ggml/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,16 @@ cmake_minimum_required(VERSION 3.14...3.28) # for add_link_options and implicit
if (POLICY CMP0194)
cmake_policy(SET CMP0194 NEW)
endif()
project("ggml" C CXX ASM)

# Only call project() when ggml is the top-level build. When consumed as a
# subdirectory (FetchContent, CPM, etc.), a second project() would re-run
# toolchain detection and can clobber parent-project settings such as
# CMAKE_OSX_ARCHITECTURES, CMAKE_OSX_SYSROOT or CMAKE_ASM_COMPILER during
# cross-compilation (iOS, Android NDK, arm64/x86_64 hosts).
# See: https://github.com/ggml-org/llama.cpp/issues/20415
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
project("ggml" C CXX ASM)
endif()

### GGML Version
set(GGML_VERSION_MAJOR 0)
Expand Down