ENABLE_PROFILING_ITT option is ignored if ITT library not found (#1647)

This commit is contained in:
Vladislav Volkov 2020-08-06 13:20:35 +03:00 committed by GitHub
parent 58fe0106cc
commit 8ae30481f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -44,4 +44,4 @@ ie_dependent_option (ENABLE_AVX2 "Enable AVX2 optimizations" ON "X86_64 OR X86"
ie_dependent_option (ENABLE_AVX512F "Enable AVX512 optimizations" ON "X86_64 OR X86" OFF)
ie_dependent_option (ENABLE_PROFILING_ITT "ITT tracing of IE and plugins internals" OFF "NOT CMAKE_CROSSCOMPILING" OFF)
ie_dependent_option (ENABLE_PROFILING_ITT "ITT tracing of IE and plugins internals" ON "NOT CMAKE_CROSSCOMPILING" OFF)

View File

@ -21,7 +21,10 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
file(GLOB_RECURSE SOURCES "src/*.cpp")
if(ENABLE_PROFILING_ITT)
find_package(ITT REQUIRED)
find_package(ITT)
if(NOT ITT_FOUND)
message(WARNING "Profiling option enabled, but no ITT library was found")
endif()
endif()
add_library(${TARGET_NAME} STATIC ${SOURCES})