hide unused arguments warnings

This commit is contained in:
Li Jie
2025-08-23 17:20:27 +08:00
parent 59e1df5478
commit b7181592a9

View File

@@ -229,11 +229,16 @@ func use(goos, goarch string, wasiThreads bool) (export Export, err error) {
export.LDFLAGS = []string{ export.LDFLAGS = []string{
"-L" + clangLib, "-L" + clangLib,
"-target", targetTriple, "-target", targetTriple,
"-Wno-override-module", "-Qunused-arguments",
"-Wno-unused-command-line-argument",
"-Wl,--error-limit=0", "-Wl,--error-limit=0",
"-fuse-ld=lld", "-fuse-ld=lld",
} }
export.CFLAGS = append(export.CFLAGS, "-I"+clangInc) export.CFLAGS = append(export.CFLAGS, "-I"+clangInc)
export.CCFLAGS = []string{
"-Qunused-arguments",
"-Wno-unused-command-line-argument",
}
// Add platform-specific rpath flags // Add platform-specific rpath flags
switch goos { switch goos {
@@ -327,6 +332,8 @@ func use(goos, goarch string, wasiThreads bool) (export Export, err error) {
} }
export.CFLAGS = []string{ export.CFLAGS = []string{
"-I" + includeDir, "-I" + includeDir,
"-Qunused-arguments",
"-Wno-unused-command-line-argument",
} }
// Add WebAssembly linker flags // Add WebAssembly linker flags
export.LDFLAGS = append(export.LDFLAGS, export.CCFLAGS...) export.LDFLAGS = append(export.LDFLAGS, export.CCFLAGS...)
@@ -377,6 +384,8 @@ func use(goos, goarch string, wasiThreads bool) (export Export, err error) {
// Add compiler flags // Add compiler flags
export.CCFLAGS = []string{ export.CCFLAGS = []string{
"-target", targetTriple, "-target", targetTriple,
"-Qunused-arguments",
"-Wno-unused-command-line-argument",
} }
export.CFLAGS = []string{} export.CFLAGS = []string{}
// Add WebAssembly linker flags for Emscripten // Add WebAssembly linker flags for Emscripten
@@ -458,7 +467,7 @@ func useTarget(targetName string) (export Export, err error) {
var ccflags []string var ccflags []string
var ldflags []string var ldflags []string
cflags := []string{"-Wno-override-module", "-Qunused-arguments"} cflags := []string{"-Wno-override-module", "-Qunused-arguments", "-Wno-unused-command-line-argument"}
if config.LLVMTarget != "" { if config.LLVMTarget != "" {
cflags = append(cflags, "--target="+config.LLVMTarget) cflags = append(cflags, "--target="+config.LLVMTarget)
ccflags = append(ccflags, "--target="+config.LLVMTarget) ccflags = append(ccflags, "--target="+config.LLVMTarget)