diff --git a/cmake/api_validator.cmake b/cmake/api_validator/api_validator.cmake similarity index 72% rename from cmake/api_validator.cmake rename to cmake/api_validator/api_validator.cmake index b465ad17fc0d12..35028585216c5e 100644 --- a/cmake/api_validator.cmake +++ b/cmake/api_validator/api_validator.cmake @@ -54,8 +54,7 @@ function(_ie_add_api_validator_post_build_step) set(UWP_API_VALIDATOR_APIS "${PROGRAMFILES}/Windows Kits/10/build/universalDDIs/x64/UniversalDDIs.xml") set(UWP_API_VALIDATOR_EXCLUSION "${UWP_SDK_PATH}/BinaryExclusionlist.xml") - if(NOT UWP_API_VALIDATOR OR (WINDOWS_STORE OR WINDOWS_PHONE) OR - NOT EXISTS UWP_API_VALIDATOR_APIS OR NOT EXISTS UWP_API_VALIDATOR_EXCLUSION) + if((NOT UWP_API_VALIDATOR) OR (WINDOWS_STORE OR WINDOWS_PHONE)) return() endif() @@ -85,24 +84,35 @@ function(_ie_add_api_validator_post_build_step) return() endif() - # generate rules + # apply check + + macro(api_validator_get_target_name) + get_target_property(IS_IMPORTED ${target} IMPORTED) + if(IS_IMPORTED) + get_target_property(target_location ${target} LOCATION) + get_filename_component(target_name "${target_location}" NAME_WE) + else() + set(target_name ${target}) + endif() + endmacro() foreach(target IN LISTS API_VALIDATOR_TARGETS) - list(APPEND commands - COMMAND "${UWP_API_VALIDATOR}" - -SupportedApiXmlFiles:${UWP_API_VALIDATOR_APIS} - -BinaryExclusionListXmlFile:${UWP_API_VALIDATOR_EXCLUSION} - -StrictCompliance:TRUE - -DriverPackagePath:$) + api_validator_get_target_name() + set(output_file "${CMAKE_BINARY_DIR}/api_validator/${target_name}.txt") + + add_custom_command(TARGET ${API_VALIDATOR_TARGET} POST_BUILD + COMMAND ${CMAKE_COMMAND} + -D UWP_API_VALIDATOR=${UWP_API_VALIDATOR} + -D UWP_API_VALIDATOR_TARGET=$ + -D UWP_API_VALIDATOR_APIS=${UWP_API_VALIDATOR_APIS} + -D UWP_API_VALIDATOR_EXCLUSION=${UWP_API_VALIDATOR_EXCLUSION} + -D UWP_API_VALIDATOR_OUTPUT=${output_file} + -P "${OpenVINO_MAIN_SOURCE_DIR}/cmake/api_validator/api_validator_run.cmake" + BYPRODUCTS ${output_file} + COMMENT "[apiValidator] Check ${target_name} for OneCore compliance" + VERBATIM) endforeach() - # apply rules - - add_custom_command(TARGET ${API_VALIDATOR_TARGET} POST_BUILD - ${commands} - COMMENT "[apiValidator] Check ${API_VALIDATOR_TARGET} and its dependencies for WCOS compatibility" - VERBATIM) - # update list of validated libraries list(APPEND VALIDATED_LIBRARIES ${API_VALIDATOR_TARGETS}) diff --git a/cmake/api_validator/api_validator_run.cmake b/cmake/api_validator/api_validator_run.cmake new file mode 100644 index 00000000000000..c53f9dc29b9f54 --- /dev/null +++ b/cmake/api_validator/api_validator_run.cmake @@ -0,0 +1,69 @@ +# Copyright (C) 2018-2020 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 +# + +cmake_policy(SET CMP0012 NEW) + +foreach(var UWP_API_VALIDATOR UWP_API_VALIDATOR_TARGET + UWP_API_VALIDATOR_APIS UWP_API_VALIDATOR_EXCLUSION + UWP_API_VALIDATOR_OUTPUT) + if(NOT DEFINED ${var}) + message(FATAL_ERROR "Variable ${var} is not defined") + endif() +endforeach() + +# create command + +if(NOT EXISTS "${UWP_API_VALIDATOR_APIS}") + message(FATAL_ERROR "${UWP_API_VALIDATOR_APIS} does not exist") +endif() + +set(command "${UWP_API_VALIDATOR}" + -SupportedApiXmlFiles:${UWP_API_VALIDATOR_APIS} + -DriverPackagePath:${UWP_API_VALIDATOR_TARGET}) +if(EXISTS "${UWP_API_VALIDATOR_EXCLUSION}") + list(APPEND command + -BinaryExclusionListXmlFile:${UWP_API_VALIDATOR_EXCLUSION} + -StrictCompliance:TRUE) + set(UWP_HAS_BINARY_EXCLUSION ON) +endif() + +# execute + +execute_process(COMMAND ${command} + OUTPUT_VARIABLE output_message + ERROR_VARIABLE error_message + RESULT_VARIABLE exit_code + OUTPUT_STRIP_TRAILING_WHITESPACE) + +file(WRITE "${UWP_API_VALIDATOR_OUTPUT}" "${output_message}\n\n\n${error_message}") + +# post-process output + +get_filename_component(name "${UWP_API_VALIDATOR_TARGET}" NAME) + +if(NOT UWP_HAS_BINARY_EXCLUSION) + set(exclusion_dlls "msvcp140.dll" "vcruntime140.dll") + + # remove exclusions from error_message + + foreach(dll IN LISTS exclusion_dlls) + string(REGEX REPLACE + "ApiValidation: Error: ${name} has unsupported API call to \"${dll}![^\"]+\"\n" + "" error_message "${error_message}") + endforeach() + + # throw error if error_message still contains any errors + + if(error_message) + message(FATAL_ERROR "${error_message}") + endif() +endif() + +# write output + +if(UWP_HAS_BINARY_EXCLUSION AND NOT exit_code EQUAL 0) + message(FATAL_ERROR "${error_message}") +endif() + +message("ApiValidator: ${name} has passed the OneCore compliance") diff --git a/cmake/developer_package.cmake b/cmake/developer_package.cmake index 03e8e11c03ae82..a31af79fc43c27 100644 --- a/cmake/developer_package.cmake +++ b/cmake/developer_package.cmake @@ -237,7 +237,7 @@ include(os_flags) include(sanitizer) include(cross_compiled_func) include(faster_build) -include(api_validator) +include(api_validator/api_validator) function(set_ci_build_number) set(OpenVINO_MAIN_SOURCE_DIR "${CMAKE_SOURCE_DIR}") @@ -245,3 +245,5 @@ function(set_ci_build_number) set(CI_BUILD_NUMBER "${CI_BUILD_NUMBER}" PARENT_SCOPE) endfunction() set_ci_build_number() + +set(CMAKE_VERBOSE_MAKEFILE ON) diff --git a/cmake/uwp.toolchain.cmake b/cmake/uwp.toolchain.cmake index 26f9b61a488ea9..f595fd9d7efd33 100644 --- a/cmake/uwp.toolchain.cmake +++ b/cmake/uwp.toolchain.cmake @@ -5,7 +5,13 @@ set(CMAKE_SYSTEM_NAME WindowsStore) if(NOT DEFINED CMAKE_SYSTEM_VERSION) - set(CMAKE_SYSTEM_VERSION 10.0) + # Sometimes CMAKE_HOST_SYSTEM_VERSION has form 10.x.y while we need + # form 10.x.y.z Adding .0 at the end fixes the issue + if(CMAKE_HOST_SYSTEM_VERSION MATCHES "^10\.0.[0-9]+$") + set(CMAKE_SYSTEM_VERSION "${CMAKE_HOST_SYSTEM_VERSION}.0") + else() + set(CMAKE_SYSTEM_VERSION "${CMAKE_HOST_SYSTEM_VERSION}") + endif() endif() if(NOT DEFINED CMAKE_SYSTEM_PROCESSOR) @@ -21,6 +27,4 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/src/uwp.hpp" set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /FI\"${CMAKE_CURRENT_BINARY_DIR}/src/uwp.hpp\"") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /FI\"${CMAKE_CURRENT_BINARY_DIR}/src/uwp.hpp\"") -# UWP setting for package isolation -# set(CMAKE_VS_GLOBALS "AppContainerApplication=true") set(CMAKE_VS_GLOBALS "WindowsTargetPlatformMinVersion=${CMAKE_SYSTEM_VERSION}") diff --git a/inference-engine/tests/functional/plugin/gna/shared_tests_instances/plugin_config.cpp b/inference-engine/tests/functional/plugin/gna/shared_tests_instances/plugin_config.cpp index 866500c26ae8d6..18db70a7fea15d 100644 --- a/inference-engine/tests/functional/plugin/gna/shared_tests_instances/plugin_config.cpp +++ b/inference-engine/tests/functional/plugin/gna/shared_tests_instances/plugin_config.cpp @@ -6,7 +6,7 @@ #include "functional_test_utils/plugin_config.hpp" #include "functional_test_utils/blob_utils.hpp" -#include "legacy/ie_ngraph_utils.hpp" +#include void PreparePluginConfiguration(LayerTestsUtils::LayerTestsCommon* test) { const float MAX_VAL_2B_FEAT = 16384.0f;