houmain / keymapper

A cross-platform context-aware key remapper.
GNU General Public License v3.0
257 stars 21 forks source link

Fail to build on macOS brew #134

Closed TheMasterDingo closed 2 months ago

TheMasterDingo commented 2 months ago

Was trying today to build it using the method described in this github page

[ 86%] Linking CXX executable keymapper /opt/homebrew/Cellar/cmake/3.29.2/bin/cmake -E cmake_link_script CMakeFiles/keymapper.dir/link.txt --verbose=1 /opt/homebrew/Library/Homebrew/shims/mac/super/clang++ -O3 -DNDEBUG -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/keymapper.dir/src/client/ConfigFile.cpp.o CMakeFiles/keymapper.dir/src/client/Settings.cpp.o CMakeFiles/keymapper.dir/src/client/ServerPort.cpp.o CMakeFiles/keymapper.dir/src/client/ControlPort.cpp.o CMakeFiles/keymapper.dir/src/client/ClientState.cpp.o CMakeFiles/keymapper.dir/src/client/unix/FocusedWindowImpl.cpp.o CMakeFiles/keymapper.dir/src/client/unix/FocusedWindowCarbon.cpp.o CMakeFiles/keymapper.dir/src/client/unix/StringTyperImpl.cpp.o CMakeFiles/keymapper.dir/src/client/unix/StringTyperGeneric.cpp.o CMakeFiles/keymapper.dir/src/client/unix/StringTyperCarbon.cpp.o CMakeFiles/keymapper.dir/src/client/unix/TrayIcon.cpp.o CMakeFiles/keymapper.dir/src/client/unix/main.cpp.o CMakeFiles/keymapper.dir/src/common/Connection.cpp.o CMakeFiles/keymapper.dir/src/common/Host.cpp.o CMakeFiles/keymapper.dir/src/common/output.cpp.o CMakeFiles/keymapper.dir/src/config/ParseConfig.cpp.o CMakeFiles/keymapper.dir/src/config/ParseKeySequence.cpp.o CMakeFiles/keymapper.dir/src/config/get_key_name.cpp.o -o keymapper -framework Carbon [ 86%] Built target keymapper make: *** [all] Error 2

I have no idea how to fix this

houmain commented 2 months ago

Hi, thanks for reporting. I could reproduce and fix it. It seems to happen only when building with brew.

For the record: The CMake file pulls the asio dependecy using FetchContent. It sets the correct include directories but the files are not extracted. As a workaround I added it to the build-dependencies of the brew formula here.

sangaline commented 1 month ago

Installation with brew is failing again because they recently disabled the use of FetchContent. I put up a PR with a fix: houmain/homebrew-tap#1. If anybody runs into this before the fix is merged, you can manually modify /opt/homebrew/Library/Taps/houmain/homebrew-tap/keymapper.rb to include the fix and then run brew install --build-from-source keymapper.