github.com/tinygo-org/tinygo@v0.31.3-0.20240404173401-90b0bf646c27/cgo/libclang_config_llvm16.go (about)

     1  //go:build !byollvm && llvm16
     2  
     3  package cgo
     4  
     5  // As of 2023-05-05, there is a packaging issue with LLVM 16 on Debian:
     6  // https://github.com/llvm/llvm-project/issues/62199
     7  // A workaround is to fix this locally, using something like this:
     8  //
     9  //   ln -sf ../../x86_64-linux-gnu/libclang-16.so.1 /usr/lib/llvm-16/lib/libclang.so
    10  
    11  /*
    12  #cgo linux        CFLAGS:  -I/usr/lib/llvm-16/include
    13  #cgo darwin,amd64 CFLAGS:  -I/usr/local/opt/llvm@16/include
    14  #cgo darwin,arm64 CFLAGS:  -I/opt/homebrew/opt/llvm@16/include
    15  #cgo freebsd      CFLAGS:  -I/usr/local/llvm16/include
    16  #cgo linux        LDFLAGS: -L/usr/lib/llvm-16/lib -lclang
    17  #cgo darwin,amd64 LDFLAGS: -L/usr/local/opt/llvm@16/lib -lclang
    18  #cgo darwin,arm64 LDFLAGS: -L/opt/homebrew/opt/llvm@16/lib -lclang
    19  #cgo freebsd      LDFLAGS: -L/usr/local/llvm16/lib -lclang
    20  */
    21  import "C"