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}
705705set (LLAMA_BUILD_NUMBER ${BUILD_NUMBER} )
706706set (LLAMA_BUILD_COMMIT ${BUILD_COMMIT} )
707707set (LLAMA_INSTALL_VERSION 0.0.${BUILD_NUMBER} )
708+ get_directory_property (LLAMA_TRANSIENT_DEFINES COMPILE_DEFINITIONS )
708709
709710configure_package_config_file(
710711 ${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
2828target_include_directories (common PUBLIC ${LLAMA_INCLUDE_DIR}
2929 ${CMAKE_CURRENT_BINARY_DIR} )
3030
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+
3141add_executable (${TARGET} ${CMAKE_CURRENT_LIST_DIR} /../main/main.cpp)
3242target_include_directories (${TARGET} PRIVATE ${_common_path} )
3343install (TARGETS ${TARGET} RUNTIME)
Original file line number Diff line number Diff line change @@ -56,11 +56,13 @@ find_library(llama_LIBRARY llama
5656 HINTS ${LLAMA_LIB_DIR} )
5757
5858set (_llama_link_deps "Threads::Threads" "@LLAMA_EXTRA_LIBS@" )
59+ set (_llama_transient_defines "@LLAMA_TRANSIENT_DEFINES@" )
5960add_library (llama UNKNOWN IMPORTED )
6061set_target_properties (llama
6162 PROPERTIES
6263 INTERFACE_INCLUDE_DIRECTORIES "${LLAMA_INCLUDE_DIR} "
6364 INTERFACE_LINK_LIBRARIES "${_llama_link_deps} "
65+ INTERFACE_COMPILE_DEFINITIONS "${_llama_transient_defines} "
6466 IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
6567 IMPORTED_LOCATION "${llama_LIBRARY} "
6668 INTERFACE_COMPILE_FEATURES cxx_std_11
You can’t perform that action at this time.
0 commit comments