chewing / libchewing

libchewing - The intelligent phonetic input method library
https://chewing.im/
GNU Lesser General Public License v2.1
356 stars 89 forks source link

libchewing 0.8.3 cmake build failure #573

Closed chenrui333 closed 1 month ago

chenrui333 commented 1 month ago

👋 trying to build the latest release, but run into some build issue. The error log is as below:

error build log ``` CMake Error at build/data/cmake_install.cmake:48 (file): file INSTALL cannot find "/tmp/libchewing-20240526-8184-ure9ze/libchewing-0.8.3/build/data/pinyin.tab": No such file or directory. Call Stack (most recent call first): build/cmake_install.cmake:47 (include) ```

full build log, https://github.com/Homebrew/homebrew-core/actions/runs/9245173161/job/25431336495?pr=172810 relates to Homebrew/homebrew-core#172810

yan12125 commented 1 month ago

The issue is that when -D BUILD_TESTING=OFF is used, static data files (pinyin.tab, swkb.dat, symbols.dat) are not copied to the binary directory as the target all_static_data is not built by default.

https://github.com/chewing/libchewing/blob/630904be227f2074d8a758dcac9b9cb9f1cfcf74/data/CMakeLists.txt#L22-L26

https://github.com/chewing/libchewing/blob/630904be227f2074d8a758dcac9b9cb9f1cfcf74/tests/CMakeLists.txt#L60

Maybe the custom target all_static_data should use the ALL option.

chenrui333 commented 1 month ago

thanks @kanru @yan12125!