this is my fish configuration:

set -x CGO_CPPFLAGS 'llvm-config --cppflags'
set -x CGO_LDFLAGS 'llvm-config --ldflags --libs --system-libs all'
set -x CGO_CXXFLAGS '-std=c++11'

I've tried running make on my LLVM-based project, but I get the following error:

clang: error: unsupported option '--cppflags'
clang: error: no such file or directory: 'llvm-config'
make: *** [all] Error 2

Is this an error in my configuration file? If so, what am I doing wrong?


1 Answer 1


Try setting the variables to the output of llvm-config using command substitutions, rather than the raw commands themselves:

set -x CGO_CPPFLAGS (llvm-config --cppflags | tr -s ' ' \n)
set -x CGO_LDFLAGS (llvm-config --ldflags --libs --system-libs all | tr -s ' ' \n)
set -x CGO_CXXFLAGS '-std=c++11'

The pipe through tr is to avoid getting bitten by a difference in behaviour between bash/zsh and fish.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.