3

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?

Jon Blow
  • 33
  • 2

1 Answers1

4

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.

Zanchey
  • 1,292
  • 6
  • 12