Skip to content

Commit 710ddf1

Browse files
authored
[MERGE] Ported compile flags fixes (#446)
* ICU compile flags (#440) * get the ov:runtime compile defenitions properly * use common cmake flags * Revert "get the ov:runtime compile defenitions properly" This reverts commit 90740ec. * Revert "use common cmake flags" This reverts commit f8fc68d. * set ICU_LINKER_FLAGS * try AdditionalLinkerOptions * try AdditionalOptions * set CL and LINK env * patch icu * Update cmake/external/icu.cmake * get the ov:runtime compile defenitions properly (#438)
1 parent 99db252 commit 710ddf1

File tree

4 files changed

+18
-8
lines changed

4 files changed

+18
-8
lines changed

.github/workflows/linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
- ${{ github.workspace }}:${{ github.workspace }}
4848

4949
steps:
50-
- uses: openvinotoolkit/openvino/.github/actions/openvino_provider@master
50+
- uses: openvinotoolkit/openvino/.github/actions/openvino_provider@releases/2025/1
5151
id: openvino_download
5252
with:
5353
platform: 'ubuntu22'

.github/workflows/mac.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ jobs:
4242
- ${{ github.workspace }}:${{ github.workspace }}
4343

4444
steps:
45-
- uses: openvinotoolkit/openvino/.github/actions/openvino_provider@master
45+
- uses: openvinotoolkit/openvino/.github/actions/openvino_provider@releases/2025/1
4646
id: openvino_download
4747
with:
4848
platform: 'macos_12_6'
4949
commit_packages_to_provide: 'wheels'
50-
revision: latest_nightly
50+
revision: latest_available_commit
5151

5252
openvino_tokenizers_cpack:
5353
name: OpenVINO tokenizers cpack (BUILD_TYPE=${{ matrix.build_type }})

.github/workflows/windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
continue-on-error: true
4545

4646
steps:
47-
- uses: openvinotoolkit/openvino/.github/actions/openvino_provider@master
47+
- uses: openvinotoolkit/openvino/.github/actions/openvino_provider@releases/2025/1
4848
id: openvino_download
4949
with:
5050
platform: 'windows'

cmake/external/icu.cmake

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,14 @@ set(ICU_INCLUDE_DIRS "${ICU_INSTALL_DIR}/include")
7676

7777
# Compile & link flags
7878

79+
set(ICU_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
80+
set(ICU_C_FLAGS "${CMAKE_C_FLAGS}")
81+
set(ICU_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
82+
7983
if(NOT WIN32)
80-
set(ICU_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wno-deprecated-declarations")
81-
set(ICU_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -Wno-deprecated-declarations")
8284
set(ICU_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS}")
85+
set(ICU_CXX_FLAGS "${ICU_CXX_FLAGS} -fPIC -Wno-deprecated-declarations")
86+
set(ICU_C_FLAGS "${ICU_C_FLAGS} -fPIC -Wno-deprecated-declarations")
8387
if (CMAKE_DL_LIBS)
8488
set(ICU_LINKER_FLAGS "${ICU_LINKER_FLAGS} -l${CMAKE_DL_LIBS}")
8589
endif()
@@ -88,15 +92,20 @@ endif()
8892
# openvino::runtime exports _GLIBCXX_USE_CXX11_ABI=0 on CentOS7.
8993
# It needs to be propagated to every library openvino_tokenizers links with.
9094
# That prohibits linkage with prebuilt libraries because they aren't compiled with _GLIBCXX_USE_CXX11_ABI=0.
91-
get_directory_property(OPENVINO_RUNTIME_COMPILE_DEFINITIONS COMPILE_DEFINITIONS)
95+
get_target_property(OPENVINO_RUNTIME_COMPILE_DEFINITIONS openvino::runtime INTERFACE_COMPILE_DEFINITIONS)
9296

9397
if(OPENVINO_RUNTIME_COMPILE_DEFINITIONS)
98+
message(INFO "Propagating OPENVINO_RUNTIME_COMPILE_DEFINITIONS to ICU: ${OPENVINO_RUNTIME_COMPILE_DEFINITIONS}")
9499
foreach(def IN LISTS OPENVINO_RUNTIME_COMPILE_DEFINITIONS)
95100
set(ICU_CXX_FLAGS "${ICU_CXX_FLAGS} -D${def}")
96101
set(ICU_C_FLAGS "${ICU_C_FLAGS} -D${def}")
97102
endforeach()
98103
endif()
99104

105+
message(STATUS "ICU_CXX_FLAGS: ${ICU_CXX_FLAGS}")
106+
message(STATUS "ICU_C_FLAGS: ${ICU_C_FLAGS}")
107+
message(STATUS "ICU_LINKER_FLAGS: ${ICU_LINKER_FLAGS}")
108+
100109
# Build
101110

102111
#
@@ -186,8 +195,9 @@ function(ov_tokenizer_build_icu)
186195
SOURCE_DIR ${ICU_SOURCE_DIR}
187196
BINARY_DIR ${ARG_BUILD_DIR}
188197
INSTALL_DIR ${ARG_INSTALL_DIR}
198+
PATCH_COMMAND powershell -Command "(Get-ChildItem -Path <SOURCE_DIR>/source -Recurse -File -Filter "*.vcxproj" | ForEach-Object { (Get-Content $_.FullName) -replace '<DebugInformationFormat>EditAndContinue</DebugInformationFormat>', '<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>' | Set-Content $_.FullName })"
189199
CONFIGURE_COMMAND ""
190-
BUILD_COMMAND msbuild ${ICU_SOURCE_DIR}\\source\\allinone\\allinone.sln /p:Configuration=${ICU_BUILD_TYPE} /p:Platform=x64 /t:i18n /t:uconv /t:makedata
200+
BUILD_COMMAND ${CMAKE_COMMAND} -E env CL=${ICU_CXX_FLAGS} LINK=${ICU_LINKER_FLAGS} msbuild ${ICU_SOURCE_DIR}\\source\\allinone\\allinone.sln /p:Configuration=${ICU_BUILD_TYPE} /p:Platform=x64 /t:i18n /t:uconv /t:makedata
191201
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory ${ICU_SOURCE_DIR}/include ${ARG_INSTALL_DIR}/include &&
192202
${CMAKE_COMMAND} -E copy_directory ${ICU_SOURCE_DIR}/lib64 ${ARG_INSTALL_DIR}/${ICU_BUILD_TYPE}/${ICU_INSTALL_LIB_SUBDIR} &&
193203
${CMAKE_COMMAND} -E copy_directory ${ICU_SOURCE_DIR}/bin64 ${ARG_INSTALL_DIR}/${ICU_BUILD_TYPE}/${ICU_INSTALL_BIN_SUBDIR}

0 commit comments

Comments
 (0)