File tree Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -705,6 +705,7 @@ set(LLAMA_BIN_INSTALL_DIR ${CMAKE_INSTALL_BINDIR}
705
705
set (LLAMA_BUILD_NUMBER ${BUILD_NUMBER} )
706
706
set (LLAMA_BUILD_COMMIT ${BUILD_COMMIT} )
707
707
set (LLAMA_INSTALL_VERSION 0.0.${BUILD_NUMBER} )
708
+ get_directory_property (LLAMA_TRANSIENT_DEFINES COMPILE_DEFINITIONS )
708
709
709
710
configure_package_config_file (
710
711
${CMAKE_CURRENT_SOURCE_DIR} /scripts/LlamaConfig.cmake.in
Original file line number Diff line number Diff line change @@ -28,6 +28,16 @@ configure_file(${_common_path}/../build-info.h
28
28
target_include_directories (common PUBLIC ${LLAMA_INCLUDE_DIR}
29
29
${CMAKE_CURRENT_BINARY_DIR} )
30
30
31
+ # If the common project was part of "main-cmake-pkg" the transient
32
+ # defines would automatically be attached. Because the common func-
33
+ # tionality is separate, but dependent upon the defines, it must be
34
+ # explicitly extracted from the "llama" target.
35
+ #
36
+ get_target_property (_llama_transient_defines llama
37
+ INTERFACE_COMPILE_DEFINITIONS )
38
+
39
+ target_compile_definitions (common PRIVATE "${_llama_transient_defines} " )
40
+
31
41
add_executable (${TARGET} ${CMAKE_CURRENT_LIST_DIR} /../main/main.cpp )
32
42
target_include_directories (${TARGET} PRIVATE ${_common_path} )
33
43
install (TARGETS ${TARGET} RUNTIME )
Original file line number Diff line number Diff line change @@ -56,11 +56,13 @@ find_library(llama_LIBRARY llama
56
56
HINTS ${LLAMA_LIB_DIR} )
57
57
58
58
set (_llama_link_deps "Threads::Threads" "@LLAMA_EXTRA_LIBS@" )
59
+ set (_llama_transient_defines "@LLAMA_TRANSIENT_DEFINES@" )
59
60
add_library (llama UNKNOWN IMPORTED )
60
61
set_target_properties (llama
61
62
PROPERTIES
62
63
INTERFACE_INCLUDE_DIRECTORIES "${LLAMA_INCLUDE_DIR} "
63
64
INTERFACE_LINK_LIBRARIES "${_llama_link_deps} "
65
+ INTERFACE_COMPILE_DEFINITIONS "${_llama_transient_defines} "
64
66
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
65
67
IMPORTED_LOCATION "${llama_LIBRARY} "
66
68
INTERFACE_COMPILE_FEATURES cxx_std_11
You can’t perform that action at this time.
0 commit comments