From a04986a82ae7f4817fe32fb6b7b6f6093b03ecee Mon Sep 17 00:00:00 2001 From: Egor Tyuvaev Date: Tue, 6 Aug 2024 22:48:45 +0200 Subject: [PATCH] Fix ONNX frontend code generation (#25937) ### Details ONNX frontend has code generation when `BUILD_SHARED_LIBS=OFF` which targets a file inside source directory. When configuring the project, the generated file is written to the sources directory. If two configurations are running at the same time (i.e. when trying to build the package with `vcpkg` it configures debug and release builds concurrently), both `cmake` instances append lines to the same file inside source directory which leads to corrupted file content and cryptic build errors. This change makes the script write generated header file to a directory inside build directory, so that two different configuration processes don't interfere with each other. --- src/frontends/onnx/frontend/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontends/onnx/frontend/CMakeLists.txt b/src/frontends/onnx/frontend/CMakeLists.txt index 0ceeec8f7606a3..80fd16e2ed6483 100644 --- a/src/frontends/onnx/frontend/CMakeLists.txt +++ b/src/frontends/onnx/frontend/CMakeLists.txt @@ -4,7 +4,7 @@ if(NOT BUILD_SHARED_LIBS) file(GLOB_RECURSE op_list "src/op/*.cpp") - set(static_reg_file "src/static_reg.hpp") + set(static_reg_file ${CMAKE_CURRENT_BINARY_DIR}/static_reg.hpp) file(WRITE ${static_reg_file} "// Copyright (C) 2018-2024 Intel Corporation\n// SPDX-License-Identifier: Apache-2.0\n// Auto generated file, DO NOT EDIT INLINE\n\n") file(APPEND ${static_reg_file} "#include \"core/operator_set.hpp\"\n\n") file(APPEND ${static_reg_file} "#define ONNX_DECL_OP(op) extern ov::OutputVector op(const Node&)\n\n")