Files
openvino/cmake/developer_package/cpplint/cpplint_run.cmake
Ilya Lavrenov 1fa225e7bf Python in OpenVINO: improvements (#6027)
* enable make clean to remove ie_wheel artifacts

* ./setup.py:132:1: E302 expected 2 blank lines

* fix CI build issue

* Removed not-needed components from ie_wheel

* Use explicit python3 vresion in ngraph pythpn

* Use python3 everywhere

* Reuse python3 more

* Added function to build with Py_LIMITED_API

* Sync 2 cmake python modules

* Fix for tools

* Fixed typo

* Enable python by default

* Enable python build iff python-dev is found

* More migration to Python3_VERSION

* Install wheel requirements

* Fixed ngraph Python separate build

* Fixed cython compilation

* Revert to old packages

* Added suffix

* Specify python version explicitly

* Don't depend on python interp to build python itself

* More improvements

* Revert offline transformations back to ie_wheel

* Refactoring

* Trying to build wheel independently on C++ runtime

* Build wheel only with main OpenVINO

* Fixed typo in test_utils cmake lists

* Adding link stage

* small fix

* git diff

* Try to fix python tests

Co-authored-by: Sergey Lyubimtsev <sergey.lyubimtsev@intel.com>
2021-06-07 10:52:48 +03:00

56 lines
1.6 KiB
CMake

# Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
file(REMOVE "${OUTPUT_FILE}")
set(DEFAULT_FILTER "
-build/header_guard,\
-build/include,\
-build/include_order,\
-build/include_subdir,\
-build/include_what_you_use,\
-build/namespaces,\
-build/c++11,\
-whitespace/indent,\
-whitespace/comments,\
-whitespace/ending_newline,\
-runtime/references,\
-runtime/int,\
-runtime/explicit,\
-readability/todo,\
-readability/fn_size,\
")
set(FILTER "${DEFAULT_FILTER}${CUSTOM_FILTER}")
execute_process(
COMMAND
"${PYTHON_EXECUTABLE}"
"${CPPLINT_SCRIPT}"
"--linelength=160"
"--counting=detailed"
"--quiet"
"--filter=${FILTER}"
"${INPUT_FILE}"
WORKING_DIRECTORY "${WORKING_DIRECTORY}"
RESULT_VARIABLE result
OUTPUT_VARIABLE output
ERROR_VARIABLE output)
# Store cpplint output to file (replace problematic symbols)
string(REPLACE "\"" "&quot\;" formatted_output "${output}")
string(REPLACE "<" "&lt\;" formatted_output "${formatted_output}")
string(REPLACE ">" "&gt\;" formatted_output "${formatted_output}")
string(REPLACE "'" "&apos\;" formatted_output "${formatted_output}")
string(REPLACE "&" "&amp\;" formatted_output "${formatted_output}")
file(WRITE "${OUTPUT_FILE}" "${formatted_output}")
if(NOT SKIP_RETURN_CODE)
# Pass through the cpplint return code
if(NOT result EQUAL "0")
# Display the cpplint output to console (to parse it form IDE)
message("${output}")
message(FATAL_ERROR "[cpplint] Code style check failed for : ${INPUT_FILE}")
endif()
endif()