Skip to content

Commit

Permalink
github action/cmake: fix macos icu linking
Browse files Browse the repository at this point in the history
  • Loading branch information
zdenop committed Nov 9, 2022
1 parent 490611e commit 7d073f2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ jobs:
brew install leptonica
brew install libarchive
brew install pango
brew install icu4c && brew link icu4c
brew install cabextract
brew install ninja
ninja --version
Expand Down
3 changes: 1 addition & 2 deletions src/training/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,7 @@ if(ICU_FOUND)
PkgConfig::ICU)
else()
target_link_libraries(unicharset_training PUBLIC common_training
${ICU_LIBRARIES}
${ICU_LINK_LIBRARIES})
${ICU_LIBRARIES})
endif()
endif()
target_include_directories(unicharset_training
Expand Down

3 comments on commit 7d073f2

@amitdo
Copy link
Collaborator

@amitdo amitdo commented on 7d073f2 Nov 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CMake macOS 11 CI:

FAILED: bin/combine_lang_model
: && /usr/bin/clang++ -O3 -DNDEBUG -Wno-unused-command-line-argument -isysroot /Applications/Xcode_13.2.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk -mmacosx-version-min=11.7 -Wl,-search_paths_first -Wl,-headerpad_max_install_names src/training/CMakeFiles/combine_lang_model.dir/combine_lang_model.cpp.o -o bin/combine_lang_model -L/usr/local/Cellar/leptonica/1.82.0_1/lib -Wl,-rpath,/usr/local/Cellar/leptonica/1.82.0_1/lib src/training/libunicharset_training.a src/training/libcommon_training.a libtesseract.a -lpthread -larchive /Applications/Xcode_13.2.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/lib/libcurl.tbd -llept -licui18n -licuuc -licudata && :
ld: library not found for -licui18n
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@amitdo
Copy link
Collaborator

@amitdo amitdo commented on 7d073f2 Nov 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zdenop
Copy link
Contributor Author

@zdenop zdenop commented on 7d073f2 Nov 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I read that already and IMO relevant part of suggestion was implemented. My understanding of problem is:

  1. that icu* lib are not installed in paths search by linker.
  2. even pkg-config and cmake finds icu they does not report libs location according my tests (cmake provides absolute path to libs but parsing absolute path in cmake sound a little bit crazy solution for me).

But know in log I find hit:

image

-> changes done in 78bcc0d

Please sign in to comment.