Use glob to load common files
This commit is contained in:
parent
35157e4c0e
commit
3616ed585b
1 changed files with 6 additions and 15 deletions
|
@ -7,22 +7,13 @@ find_package(Llama 0.0.1 REQUIRED)
|
||||||
# Bake common functionality in with target. Because applications
|
# Bake common functionality in with target. Because applications
|
||||||
# using the relocatable Llama package should be outside of the
|
# using the relocatable Llama package should be outside of the
|
||||||
# source tree, main-cmake-pkg pretends the dependencies are built-in.
|
# source tree, main-cmake-pkg pretends the dependencies are built-in.
|
||||||
|
|
||||||
# WARNING: because build-info.cpp is auto-generated, it will only
|
|
||||||
# be available after the user has built the llama.cpp sources.
|
|
||||||
|
|
||||||
set(_common_path "${CMAKE_CURRENT_LIST_DIR}/../../common")
|
set(_common_path "${CMAKE_CURRENT_LIST_DIR}/../../common")
|
||||||
add_library(common OBJECT
|
add_library(common OBJECT)
|
||||||
${_common_path}/common.h
|
file(GLOB _common_files
|
||||||
${_common_path}/common.cpp
|
"${_common_path}/*.h"
|
||||||
${_common_path}/console.h
|
"${_common_path}/*.cpp"
|
||||||
${_common_path}/console.cpp
|
)
|
||||||
${_common_path}/grammar-parser.h
|
target_sources(common PRIVATE ${_common_files})
|
||||||
${_common_path}/grammar-parser.cpp
|
|
||||||
${_common_path}/sampling.h
|
|
||||||
${_common_path}/sampling.cpp
|
|
||||||
${_common_path}/build-info.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
# If the common project was part of "main-cmake-pkg" the transient
|
# If the common project was part of "main-cmake-pkg" the transient
|
||||||
# defines would automatically be attached. Because the common func-
|
# defines would automatically be attached. Because the common func-
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue