hyprlang
hyprlang copied to clipboard
Fails to build on FreeBSD
Regressed by 554c95a8468c. FreeBSD for historic reasons uses libcxxrt instead of libc++abi.
Passing -lc++ and -lc++-abi isn't necessary when using C++ compiler as linker. Even when using C (not C++) compiler for linking passing -lc++abi (or -lcxxrt) is not necessary when linking dynamically as libc++ itself is usually linked against the right C++ runtime.
$ c++ --version
FreeBSD clang version 18.1.5 (https://github.com/llvm/llvm-project.git llvmorg-18.1.5-0-g617a15a9eac9)
Target: x86_64-unknown-freebsd15.0
Thread model: posix
InstalledDir: /usr/bin
$ cmake -G Ninja
$ cmake --build .
[1/2] Linking CXX executable hyprlang_test
FAILED: hyprlang_test
: && /usr/bin/c++ -stdlib=libc++ -lc++abi CMakeFiles/hyprlang_test.dir/tests/parse/main.cpp.o -o hyprlang_test -Wl,-rpath,/a/hyprlang libhyprlang.so.0.5.2 && :
ld: error: unable to find library -lc++abi
c++: error: linker command failed with exit code 1 (use -v to see invocation)
[2/2] Linking CXX executable hyprlang_fuzz
FAILED: hyprlang_fuzz
: && /usr/bin/c++ -stdlib=libc++ -lc++abi CMakeFiles/hyprlang_fuzz.dir/tests/fuzz/main.cpp.o -o hyprlang_fuzz -Wl,-rpath,/a/hyprlang libhyprlang.so.0.5.2 && :
ld: error: unable to find library -lc++abi
c++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.