Files
openvino/inference-engine/thirdparty/movidius/mvnc/CMakeLists.txt

78 lines
1.8 KiB
CMake
Raw Normal View History

# Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
set(TARGET_NAME "mvnc")
2020-02-11 22:48:49 +03:00
include(${XLINK_DIR}/XLink.cmake)
2020-02-11 22:48:49 +03:00
file(GLOB_RECURSE MVNC_SOURCES "include/*" "src/*")
2020-02-11 22:48:49 +03:00
set(WATCHDOG_INCLUDE
${CMAKE_CURRENT_SOURCE_DIR}/include/watchdog/)
2020-02-11 22:48:49 +03:00
add_library(${TARGET_NAME} STATIC ${MVNC_SOURCES})
target_include_directories(${TARGET_NAME}
2020-02-11 22:48:49 +03:00
PUBLIC
"include"
${WATCHDOG_INCLUDE}
PRIVATE
2020-02-11 22:48:49 +03:00
${XLINK_INCLUDE}
${XLINK_PLATFORM_INCLUDE})
target_compile_definitions(${TARGET_NAME}
2020-02-11 22:48:49 +03:00
PRIVATE
__PC__
HAVE_STRUCT_TIMESPEC
2020-02-11 22:48:49 +03:00
_CRT_SECURE_NO_WARNINGS
USE_USB_VSC)
if (ENABLE_MYRIAD_NO_BOOT)
target_compile_definitions(${TARGET_NAME} PRIVATE NO_BOOT)
endif()
if(NOT WIN32)
target_compile_options(${TARGET_NAME}
2020-02-11 22:48:49 +03:00
PRIVATE
-Wformat
-Wformat-security
-Wall)
2020-02-11 22:48:49 +03:00
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER 4.8.5)
target_compile_options(${TARGET_NAME}
2020-02-11 22:48:49 +03:00
PRIVATE
-fstack-protector-strong)
else()
target_compile_options(${TARGET_NAME}
2020-02-11 22:48:49 +03:00
PRIVATE
-fstack-protector)
endif()
set_property(TARGET ${TARGET_NAME}
2020-02-11 22:48:49 +03:00
PROPERTY LINK_FLAGS
-z noexecstack
-z relro
-z now)
endif()
set_target_properties(${TARGET_NAME} PROPERTIES
2020-02-11 22:48:49 +03:00
POSITION_INDEPENDENT_CODE TRUE
COMPILE_PDB_NAME ${TARGET_NAME})
target_link_libraries(${TARGET_NAME}
PRIVATE
2020-02-11 22:48:49 +03:00
XLink)
if(NOT WIN32)
target_link_libraries(${TARGET_NAME}
2020-02-11 22:48:49 +03:00
PUBLIC
Threads::Threads
${CMAKE_DL_LIBS}
${LIBUSB_LIBRARY})
endif()
2020-04-13 21:17:23 +03:00
if(ENABLE_TESTS AND ENABLE_MYRIAD_MVNC_TESTS)
add_subdirectory(tests)
endif()