forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from emmanuelattia-philips/ngraph_static_lib_2
Rebase from openvinotoolkit/master
- Loading branch information
Showing
5 changed files
with
106 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters