p-ranav / fccf

fccf: A command-line tool that quickly searches through C/C++ source code in a directory based on a search string and prints relevant code snippets that match the query.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

compile on Mac OS 12.2.1 have problem

zzuse opened this issue · comments

commented

Hi,
Thanks for your project. I'm interested in this project, so I try to compile on osx, but I got an error. I found out the problem later, so I open an issue. Is it a real problem?
(I installed dependency first, brew install cmake llvm, then I build)
ld: warning: directory not found for option '-L/usr/local/Cellar/llvm/13.0.1_1/lib -Wl,-search_paths_first -Wl,-headerpad_max_install_names'
ld: library not found for -lLLVM-13
clang: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[2]: *** [CMakeFiles/fccf_exe.dir/build.make:107: fccf] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:228: CMakeFiles/fccf_exe.dir/all] Error 2
gmake: *** [Makefile:156: all] Error 2

I fixed it by adding one line below.

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -111,6 +111,7 @@ target_include_directories(

target_compile_features(fccf_lib PUBLIC cxx_std_17)
target_compile_options (fccf_lib PRIVATE -fexceptions)
+separate_arguments(LLVM_LDFLAGS UNIX_COMMAND "${LLVM_LDFLAGS}")
target_link_options(fccf_lib PRIVATE ${LLVM_LDFLAGS})
target_link_libraries(fccf_lib PRIVATE fmt::fmt Threads::Threads)