Skip to content

Commit 063b60b

Browse files
committed
Enable pch for more targets
1 parent 8a135a0 commit 063b60b

File tree

29 files changed

+68
-14
lines changed

29 files changed

+68
-14
lines changed

cmake/developer_package/faster_build.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ include(CMakeParseArguments)
77
function(ov_build_target_faster TARGET_NAME)
88
# ENABLE_FASTER_BUILD option enables usage of precompiled headers
99
# ENABLE_UNITY_BUILD option enalbles unity build
10-
cmake_parse_arguments(FASTER_BUILD "PCH" "UNITY" "PCH_HEADER" "PCH_EXCLUDE" ${ARGN})
10+
set(options PCH UNITY)
11+
set(oneValueArgs PCH_HEADER)
12+
set(multiValueArgs PCH_EXCLUDE)
13+
cmake_parse_arguments(PARSE_ARGV 0 FASTER_BUILD "${options}" "${oneValueArgs}" "${multiValueArgs}")
1114

1215
if(FASTER_BUILD_UNITY AND ENABLE_UNITY_BUILD)
1316
set_target_properties(${TARGET_NAME} PROPERTIES UNITY_BUILD ON)

src/bindings/c/src/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ install(TARGETS ${TARGET_NAME} EXPORT OpenVINOTargets
6565

6666
ov_install_pdb(${TARGET_NAME})
6767

68+
ov_build_target_faster(${TARGET_NAME} PCH)
69+
6870
install(DIRECTORY ${OpenVINO_C_API_SOURCE_DIR}/include/openvino/
6971
DESTINATION ${OV_CPACK_INCLUDEDIR}/openvino
7072
COMPONENT ${OV_CPACK_COMP_CORE_C_DEV}

src/bindings/c/tests/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ add_dependencies(${TARGET_NAME} mock_engine)
3030

3131
ov_add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
3232

33+
ov_build_target_faster(${TARGET_NAME} PCH)
34+
3335
install(TARGETS ${TARGET_NAME}
3436
RUNTIME DESTINATION tests
3537
COMPONENT tests

src/bindings/python/src/pyopenvino/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ add_custom_command(TARGET ${PROJECT_NAME}
9696
ov_python_minimal_api(${PROJECT_NAME})
9797
ov_add_clang_format_target(${PROJECT_NAME}_clang FOR_TARGETS ${PROJECT_NAME})
9898

99+
ov_build_target_faster(${TARGET_NAME} PCH)
100+
99101
# install steps
100102

101103
ov_cpack_add_component(${OV_CPACK_COMP_PYTHON_OPENVINO}_${pyversion}

src/common/low_precision_transformations/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ add_library(${TARGET_NAME}_obj OBJECT
2222

2323
target_compile_definitions(${TARGET_NAME}_obj PRIVATE IMPLEMENT_OPENVINO_API)
2424

25-
ov_build_target_faster(${TARGET_NAME}_obj UNITY)
25+
ov_build_target_faster(${TARGET_NAME}_obj UNITY PCH)
2626

2727
target_link_libraries(${TARGET_NAME}_obj PRIVATE openvino::itt openvino::core::dev)
2828

src/common/low_precision_transformations/tests/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,5 @@ ov_add_test_target(
1919
LABELS
2020
OV UNIT LP_TRANSFORMATIONS
2121
)
22+
23+
ov_build_target_faster(${TARGET_NAME} PCH)

src/common/offline_transformations/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ add_cpplint_target(${TARGET_NAME}_cpplint FOR_TARGETS ${TARGET_NAME})
3232

3333
ov_add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
3434

35+
ov_build_target_faster(${TARGET_NAME} PCH)
36+
3537
# install & export
3638

3739
ov_developer_package_export_targets(TARGET ${TARGET_NAME}

src/common/snippets/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ set_target_properties(${TARGET_NAME} PROPERTIES EXPORT_NAME snippets)
2525

2626
ov_build_target_faster(${TARGET_NAME}
2727
UNITY
28+
PCH
2829
)
2930

3031
target_link_libraries(${TARGET_NAME} PUBLIC openvino::runtime

src/common/transformations/tests/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@ ov_add_test_target(
2323
LABELS
2424
OV UNIT TRANSFORMATIONS
2525
)
26+
27+
ov_build_target_faster(${TARGET_NAME} PCH)

src/common/util/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ ov_ncc_naming_style(FOR_TARGET ${TARGET_NAME}
5555

5656
set_target_properties(${TARGET_NAME} PROPERTIES PCH_CORE_HEADER_PATH "${UTIL_INCLUDE_DIR}/openvino/pch/precomp_core.hpp")
5757

58+
ov_build_target_faster(${TARGET_NAME} PCH)
59+
5860
# install & export
5961

6062
ov_install_static_lib(${TARGET_NAME} ${OV_CPACK_COMP_CORE})

src/core/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,6 @@ endif()
7878

7979
target_compile_definitions(openvino_core_obj PRIVATE IMPLEMENT_OPENVINO_API XBYAK_NO_OP_NAMES XBYAK64)
8080

81-
ov_build_target_faster(openvino_core_obj
82-
UNITY
83-
PCH_HEADER "src/precomp.hpp"
84-
PCH_EXCLUDE "src/op/util/attr_types.cpp")
85-
8681
ov_add_version_defines(src/version.cpp openvino_core_obj)
8782

8883
ov_set_threading_interface_for(openvino_core_obj)
@@ -140,6 +135,11 @@ set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/src/pass/convert_precis
140135
target_include_directories(openvino_core_obj PUBLIC $<BUILD_INTERFACE:${OV_CORE_INCLUDE_PATH}>
141136
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
142137

138+
ov_build_target_faster(openvino_core_obj
139+
UNITY
140+
PCH_HEADER "src/precomp.hpp"
141+
PCH_EXCLUDE "src/op/util/attr_types.cpp")
142+
143143
#-----------------------------------------------------------------------------------------------
144144
# Installation logic...
145145
#-----------------------------------------------------------------------------------------------

src/core/shape_inference/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ if(NOT BUILD_SHARED_LIBS)
3232
target_compile_definitions(${TARGET_NAME} PUBLIC OPENVINO_STATIC_LIBRARY)
3333
endif()
3434

35+
ov_build_target_faster(${TARGET_NAME} PCH)
36+
3537
# developer package
3638

3739
ov_install_static_lib(${TARGET_NAME} ${OV_CPACK_COMP_CORE})

src/core/template_extension/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ add_library(${TARGET_NAME} MODULE ${SRC})
2626

2727
target_link_libraries(${TARGET_NAME} PRIVATE openvino::runtime)
2828

29+
ov_build_target_faster(${TARGET_NAME} PCH)
30+
2931
# [cmake:extension]
3032
install(TARGETS ${TARGET_NAME}
3133
LIBRARY DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL)

src/core/tests/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,6 @@ if(ENABLE_OV_IR_FRONTEND)
8080
add_dependencies(${TARGET_NAME} openvino_ir_frontend)
8181
endif()
8282

83+
ov_build_target_faster(${TARGET_NAME} PCH)
84+
8385
add_subdirectory(frontend)

src/frontends/common/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ ov_ncc_naming_style(FOR_TARGET ${TARGET_NAME}_obj
7575
ADDITIONAL_INCLUDE_DIRECTORIES
7676
$<TARGET_PROPERTY:openvino::core::dev,INTERFACE_INCLUDE_DIRECTORIES>)
7777

78+
ov_build_target_faster(${TARGET_NAME}_obj PCH)
79+
7880
# Installation rules header files
7981

8082
install(DIRECTORY ${FRONTEND_INCLUDE_DIR}/openvino

src/frontends/ir/src/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ ov_add_frontend(NAME ir
66
FILEDESCRIPTION "FrontEnd to load OpenVINO IR file format"
77
LINK_LIBRARIES openvino::pugixml
88
openvino::core::dev)
9+
10+
ov_build_target_faster(openvino_ir_frontend PCH)

src/frontends/ir/tests/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,5 @@ ov_add_test_target(
2121
LABELS
2222
OV UNIT IR_FE
2323
)
24+
25+
ov_build_target_faster(${TARGET_NAME} PCH)

src/frontends/jax/src/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ ov_add_frontend(NAME jax
77
DISABLE_CPP_INSTALL
88
FILEDESCRIPTION "FrontEnd to load and convert JAX/Flax models"
99
LINK_LIBRARIES openvino::util openvino::core::dev)
10+
11+
ov_build_target_faster(openvino_jax_frontend PCH)

src/frontends/onnx/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ if(Python3_Interpreter_FOUND)
2121
endif()
2222
endif()
2323

24+
ov_build_target_faster(openvino_onnx_frontend PCH)
25+
2426
if(ENABLE_TESTS)
2527
add_subdirectory(tests)
2628
endif()

src/frontends/onnx/tests/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ if(OV_COMPILER_IS_CLANG)
148148
target_compile_options(ov_onnx_frontend_tests PRIVATE -Wno-undef -Wno-reserved-id-macro)
149149
endif()
150150

151+
ov_build_target_faster(ov_onnx_frontend_tests PCH)
152+
151153
# Install rules
152154

153155
install(TARGETS ov_onnx_frontend_tests

src/frontends/paddle/src/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ ov_add_frontend(NAME paddle
88
PROTOBUF_LITE
99
FILEDESCRIPTION "FrontEnd to load and convert PaddlePaddle file format"
1010
LINK_LIBRARIES openvino::util openvino::core::dev)
11+
12+
ov_build_target_faster(openvino_paddle_frontend PCH)

src/frontends/paddle/tests/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ if(paddlepaddle_FOUND)
5454
OUTPUT_STRIP_TRAILING_WHITESPACE
5555
)
5656
message(STATUS "PaddlePaddle version: ${PADDLE_VERSION}")
57-
57+
5858
if(PADDLE_VERSION VERSION_GREATER_EQUAL "2.6.0" OR PADDLE_VERSION VERSION_EQUAL "0.0.0")
5959
set(PADDLEDET_OPS_URL "https://raw.githubusercontent.com/PaddlePaddle/PaddleDetection/release/2.5/ppdet/modeling/ops.py")
6060
set(PADDLEDET_OPS_SHA256 "e3da816421698ee97bb272c4410a03c300ab92045b7c87cccb9e52a8c18bc088")
@@ -64,7 +64,7 @@ if(paddlepaddle_FOUND)
6464
set(PADDLEDET_OPS_SHA256 "5cc079eda295ed78b58fba8223c51d85a931a7069ecad51c6af5c2fd26b7a8cb")
6565
set(PADDLEDET_DIRNAME ${CMAKE_CURRENT_BINARY_DIR}/thirdparty/PaddleDetection/release21/ppdet/modeling/)
6666
endif()
67-
67+
6868
DownloadAndCheck(${PADDLEDET_OPS_URL} ${PADDLEDET_DIRNAME}/ops.py PADDLEDET_FATAL PADDLEDET_RESULT ${PADDLEDET_OPS_SHA256})
6969
endif()
7070

@@ -104,4 +104,6 @@ if(ENABLE_INTEL_CPU)
104104
add_dependencies(${TARGET_NAME} openvino_intel_cpu_plugin)
105105
endif()
106106

107+
ov_build_target_faster(${TARGET_NAME} PCH)
108+
107109
add_subdirectory(standalone_build)

src/frontends/pytorch/src/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ ov_add_frontend(NAME pytorch
77
SHUTDOWN_PROTOBUF
88
FILEDESCRIPTION "FrontEnd to load and convert TorchScript models from PyTorch"
99
LINK_LIBRARIES openvino::util openvino::core::dev)
10+
11+
ov_build_target_faster(openvino_pytorch_frontend PCH)

src/frontends/tensorflow/src/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ if(ENABLE_SNAPPY_COMPRESSION)
1212
target_link_libraries(openvino_tensorflow_frontend PRIVATE openvino::snappy)
1313
target_compile_definitions(openvino_tensorflow_frontend PRIVATE ENABLE_SNAPPY_COMPRESSION)
1414
endif()
15+
16+
ov_build_target_faster(openvino_tensorflow_frontend PCH)

src/frontends/tensorflow/tests/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ ov_add_test_target(
2525
EXCLUDED_SOURCE_PATHS ${EXCLUDED_TESTS}
2626
DEPENDENCIES ${TF_TESTS_DEPENDENCIES}
2727
LINK_LIBRARIES
28-
gtest_main_manifest
29-
frontend_shared_test_classes
30-
openvino_tensorflow_frontend
28+
gtest_main_manifest
29+
frontend_shared_test_classes
30+
openvino_tensorflow_frontend
3131
openvino_tensorflow_common
3232
ADD_CLANG_FORMAT
3333
LABELS
@@ -81,5 +81,7 @@ endif()
8181

8282
get_target_property(TENSORFLOW_FRONTEND_SRC_DIR openvino_tensorflow_frontend SOURCE_DIR)
8383

84+
ov_build_target_faster(${TARGET_NAME} PCH)
85+
8486
add_subdirectory(standalone_build)
8587
add_dependencies(${TARGET_NAME} tensorflow_fe_standalone_build_test)

src/frontends/tensorflow_common/src/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,5 @@ ov_ncc_naming_style(FOR_TARGET ${TARGET_NAME}
3939
ADDITIONAL_INCLUDE_DIRECTORIES
4040
$<TARGET_PROPERTY:${TARGET_NAME},INTERFACE_INCLUDE_DIRECTORIES>
4141
$<TARGET_PROPERTY:${TARGET_NAME},INCLUDE_DIRECTORIES>)
42+
43+
ov_build_target_faster(${TARGET_NAME} PCH)

src/frontends/tensorflow_lite/src/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ ov_add_frontend(NAME tensorflow_lite
66
LINKABLE_FRONTEND
77
FILEDESCRIPTION "FrontEnd to load and convert TensorFlow Lite file format"
88
LINK_LIBRARIES openvino::core::dev openvino::frontend::tensorflow_common)
9+
10+
ov_build_target_faster(openvino_tensorflow_lite_frontend PCH)

src/frontends/tensorflow_lite/tests/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ ov_add_test_target(
2020
tensorflow_lite_test_models
2121
tensorflow_lite_fe_standalone_build_test
2222
LINK_LIBRARIES
23-
gtest_main_manifest
24-
frontend_shared_test_classes
23+
gtest_main_manifest
24+
frontend_shared_test_classes
2525
openvino_tensorflow_lite_frontend
2626
ADD_CLANG_FORMAT
2727
LABELS
@@ -75,3 +75,5 @@ get_target_property(TENSORFLOW_LITE_FRONTEND_SRC_DIR openvino_tensorflow_lite_fr
7575

7676
add_subdirectory(standalone_build)
7777
add_dependencies(${TARGET_NAME} tensorflow_lite_fe_standalone_build_test)
78+
79+
ov_build_target_faster(${TARGET_NAME} PCH)

src/frontends/tests/frontend/shared/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,5 @@ target_compile_definitions(${TARGET_NAME}
3333
SHARED_LIB_SUFFIX="${OV_BUILD_POSTFIX}${CMAKE_SHARED_LIBRARY_SUFFIX}")
3434

3535
ov_add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
36+
37+
ov_build_target_faster(${TARGET_NAME} PCH)

0 commit comments

Comments
 (0)