summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2019-04-19 12:49:56 -0700
committerIan Lance Taylor <iant@golang.org>2019-04-19 12:49:56 -0700
commit77f075b6e8196ea26aa32855a5ae1ada124a02b8 (patch)
treeca554a29af7fb20c6fe22f63093ffef3a0fb6c41 /Source
parent545ab8af08868cd3136f9a5e91ff69dfcf5e3184 (diff)
downloadswig-77f075b6e8196ea26aa32855a5ae1ada124a02b8.tar.gz
When generating Go code, make -cgo the default.
Add new -no-cgo option to disable the default. Keep -cgo as a no-op for existing users.
Diffstat (limited to 'Source')
-rw-r--r--Source/Modules/go.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/Modules/go.cxx b/Source/Modules/go.cxx
index 41e8f7d0a..9e8162b5d 100644
--- a/Source/Modules/go.cxx
+++ b/Source/Modules/go.cxx
@@ -199,7 +199,7 @@ class GO:public Language {
public:
GO():package(NULL),
module(NULL),
- cgo_flag(false),
+ cgo_flag(true),
gccgo_flag(false),
go_prefix(NULL),
prefix_option(NULL),
@@ -269,6 +269,9 @@ private:
} else if (strcmp(argv[i], "-cgo") == 0) {
Swig_mark_arg(i);
cgo_flag = true;
+ } else if (strcmp(argv[i], "-no-cgo") == 0) {
+ Swig_mark_arg(i);
+ cgo_flag = false;
} else if (strcmp(argv[i], "-gccgo") == 0) {
Swig_mark_arg(i);
gccgo_flag = true;
@@ -6979,6 +6982,7 @@ extern "C" Language *swig_go(void) {
const char * const GO::usage = "\
Go Options (available with -go)\n\
-cgo - Generate cgo input files\n\
+ -no-cgo - Do not generate cgo input files\n\
-gccgo - Generate code for gccgo rather than 6g/8g\n\
-go-pkgpath <p> - Like gccgo -fgo-pkgpath option\n\
-go-prefix <p> - Like gccgo -fgo-prefix option\n\