21.C_CC

command
v0.2.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 2 Imported by: 0

README

これは何?

cgoにて利用するコンパイラを変更するには環境変数 CC で設定します。

(cgoヘッダで対応しているのは CFLAGS, CPPFLAGS, CXXFLAGS, FFLAGS と LDFLAGS です (Using cgo with the go command))

$ CC=gcc go run main.go
$ CC=clang go run main.go

ちゃんと指定されているかどうかは、go build -x した際に出力される結果の -extld=xxx の部分を見ると分かります。

$ CC=clang go run -x main.go 2>&1 | grep -o '\-extld=[^ ]*'
-extld=clang

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL