fcitx / mozc

Mozc - a Japanese Input Method Editor designed for multi-platform
Other
114 stars 11 forks source link

Fix support for fcitx installed in prefix #31

Closed danielzgtg closed 1 year ago

danielzgtg commented 1 year ago

This fixes building this mozc fork when fcitx5 is installed in prefix using CMake.

Before

ERROR: /home/home/CLionProjects/mozc/src/unix/fcitx5/BUILD:90:15: Linking unix/fcitx5/fcitx5-mozc.so failed: (Exit 1): gcc failed: error executing command (from target //unix/fcitx5:fcitx5-mozc.so) /usr/bin/gcc @bazel-out/k8-opt/bin/unix/fcitx5/fcitx5-mozc.so-2.params

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
/usr/bin/ld.gold: error: cannot find -lFcitx5Config
/usr/bin/ld.gold: error: cannot find -lFcitx5Core
/usr/bin/ld.gold: error: cannot find -lFcitx5Utils
collect2: error: ld returned 1 exit status
INFO: Elapsed time: 80.291s, Critical Path: 39.71s
INFO: 1316 processes: 126 internal, 1190 linux-sandbox.
FAILED: Build did NOT complete successfully

After

INFO: Elapsed time: 81.380s, Critical Path: 38.43s
INFO: 1316 processes: 125 internal, 1191 linux-sandbox.
INFO: Build completed successfully, 1316 total actions
wengxt commented 1 year ago

We don't touch any file outside src/unix/fcitx{,5}. Please file a issue to mozc instead.

Also, the issue itself is workaround-able if you simply pass "--linkopt=-L/some/path" to bazel.

danielzgtg commented 1 year ago

Thank you for teaching me the --linkopt option. I will add it to build_fcitx5_bazel.

Upstream mozc isn't welcoming contributions to the file changed in this PR. Additionally, it supports more than just fcitx5 and I haven't tested this change on other input methods frameworks or platforms.