File tree Expand file tree Collapse file tree 5 files changed +28
-5
lines changed
Expand file tree Collapse file tree 5 files changed +28
-5
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,8 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
3737option (ENABLE_OPENVINO_PACKAGE "Enable building the OpenVINO package" OFF )
3838option (ENABLE_NPU_COMPILER_BUILD "Enable building compiler in driver" OFF )
3939option (ENABLE_NPU_PERFETTO_BUILD "Enable building with Perfetto library" OFF )
40+ # TODO: USE_SYSTEM_LIBRARIES should also unvendor the kernel uapi header.
41+ option (USE_SYSTEM_LIBRARIES "Use system versions of third_party libraries" OFF )
4042
4143message (STATUS "option ENABLE_NPU_COMPILER_BUILD: ${ENABLE_NPU_COMPILER_BUILD} " )
4244message (STATUS "option ENABLE_NPU_PERFETTO_BUILD: ${ENABLE_NPU_PERFETTO_BUILD} " )
Original file line number Diff line number Diff line change @@ -10,13 +10,21 @@ add_compile_options(-Wno-error -include cstdint)
1010include (cmake/vpux_elf.cmake)
1111include (cmake/level-zero.cmake)
1212include (cmake/level-zero-npu-extensions.cmake)
13+ # TODO: Handle USE_SYSTEM_LIBRARIES for Perfetto SDK, too
1314if (ENABLE_NPU_PERFETTO_BUILD)
15+ if (USE_SYSTEM_LIBRARIES)
16+ message (FATAL_ERROR "USE_SYSTEM_LIBRARIES is not yet implemented for the Perfetto SDK" )
17+ endif ()
1418 include (cmake/perfetto.cmake)
1519endif ()
1620
17- set (INSTALL_GTEST OFF )
18- add_subdirectory (googletest EXCLUDE_FROM_ALL )
21+ if (NOT USE_SYSTEM_LIBRARIES)
22+ set (INSTALL_GTEST OFF )
23+ add_subdirectory (googletest EXCLUDE_FROM_ALL )
1924
20- set (YAML_CPP_INSTALL OFF )
21- set (BUILD_SHARED_LIBS OFF )
22- add_subdirectory (yaml-cpp EXCLUDE_FROM_ALL )
25+ set (YAML_CPP_INSTALL OFF )
26+ set (BUILD_SHARED_LIBS OFF )
27+ add_subdirectory (yaml-cpp EXCLUDE_FROM_ALL )
28+ else ()
29+ message (STATUS "USE_SYSTEM_LIBRARIES excluded the vendored gtest/gmock and yaml-cpp from the build" )
30+ endif ()
Original file line number Diff line number Diff line change 99# This software and the related documents are provided as is, with no express or
1010# implied warranties, other than those that are expressly stated in the License.
1111
12+ # TODO: Detect empty directory and upgrade to warning then regardless
13+ if (USE_SYSTEM_LIBRARIES)
14+ message (STATUS "USE_SYSTEM_LIBRARIES does not apply to level-zero-npu-extensions; it must always be vendored." )
15+ endif ()
16+
1217set (LEVEL_ZERO_EXT_HEADERS_DIR "${CMAKE_BINARY_DIR} /include/level_zero" )
1318file (MAKE_DIRECTORY ${LEVEL_ZERO_EXT_HEADERS_DIR} )
1419file (GLOB_RECURSE LEVEL_ZERO_HEADERS ${CMAKE_CURRENT_SOURCE_DIR} /level-zero-npu-extensions/*.h)
Original file line number Diff line number Diff line change @@ -21,6 +21,9 @@ endif()
2121find_package (LevelZero ${LEVEL_ZERO_VERSION} )
2222
2323if (NOT LevelZero_FOUND)
24+ if (USE_SYSTEM_LIBRARIES)
25+ message (FATAL_ERROR "LevelZero was not found and USE_SYSTEM_LIBRARIES was requested." )
26+ endif ()
2427 message (STATUS "LevelZero not found in the system, take one from third_party/level_zero" )
2528
2629 # EXCLUDE_FROM_ALL is used because level-zero-devel install destination starts with root
Original file line number Diff line number Diff line change @@ -15,6 +15,11 @@ if (TARGET vpux_elf)
1515 return ()
1616endif ()
1717
18+ # TODO: Detect empty directory and upgrade to warning then regardless
19+ if (USE_SYSTEM_LIBRARIES)
20+ message (STATUS "USE_SYSTEM_LIBRARIES does not apply to vpux_elf; it must always be vendored." )
21+ endif ()
22+
1823# Below function is required by vpux_elf
1924function (enable_warnings_as_errors TARGET_NAME)
2025 target_compile_options (${TARGET_NAME} PRIVATE -Wall -Wextra -Werror)
You can’t perform that action at this time.
0 commit comments