File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 44
55file (GLOB_RECURSE SOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR} /src/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR} /src/*.c" )
66
7+ # modeling/ sources rely on OpenVINO internal/dev-api headers (e.g. openvino/op/linear_attn.hpp)
8+ # and are intended to be built only when ENABLE_OPENVINO_NEW_ARCH is enabled.
9+ file (GLOB_RECURSE MODELING_SOURCES CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR} /src/modeling/*.cpp" )
10+ if (NOT ENABLE_OPENVINO_NEW_ARCH)
11+ list (REMOVE_ITEM SOURCE_FILES ${MODELING_SOURCES} )
12+ endif ()
13+
714list (APPEND SOURCE_FILES "${CMAKE_CURRENT_BINARY_DIR} /version.cpp" )
815
916# Dependencies
@@ -133,9 +140,7 @@ set(TARGET_NAME_OBJ ${TARGET_NAME}_obj)
133140add_library (${TARGET_NAME_OBJ} OBJECT ${SOURCE_FILES} )
134141
135142if (ENABLE_OPENVINO_NEW_ARCH)
136- file (GLOB_RECURSE MODELING_SOURCES CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR} /src/modeling/*.cpp" )
137- target_sources (${TARGET_NAME_OBJ} PRIVATE ${MODELING_SOURCES} )
138- target_compile_definitions (${TARGET_NAME_OBJ} PRIVATE ENABLE_OPENVINO_NEW_ARCH )
143+ target_compile_definitions (${TARGET_NAME_OBJ} PRIVATE ENABLE_OPENVINO_NEW_ARCH=1 )
139144endif ()
140145
141146target_include_directories (${TARGET_NAME_OBJ}
@@ -163,7 +168,7 @@ target_link_libraries(${TARGET_NAME_OBJ} PRIVATE openvino::runtime openvino::thr
163168
164169# modeling/ sources use internal OpenVINO dev-api headers (e.g. openvino/op/linear_attn.hpp)
165170# openvino::core::dev exposes src/core/dev_api which contains these headers.
166- if (TARGET openvino::core::dev)
171+ if (ENABLE_OPENVINO_NEW_ARCH AND TARGET openvino::core::dev)
167172 target_link_libraries (${TARGET_NAME_OBJ} PRIVATE openvino::core::dev )
168173endif ()
169174
You can’t perform that action at this time.
0 commit comments