File tree Expand file tree Collapse file tree 1 file changed +2
-26
lines changed
ruby/testdata/example/ext/example Expand file tree Collapse file tree 1 file changed +2
-26
lines changed Original file line number Diff line number Diff line change 3
3
require "mkmf"
4
4
5
5
############ Appended for go native extension
6
- find_executable ( "go" )
7
-
8
- # rubocop:disable Style/GlobalVars
9
- $objs = [ ]
10
- def $objs. empty? ; false ; end
11
- # rubocop:enable Style/GlobalVars
12
-
6
+ require "go_gem/mkmf"
13
7
############ Appended for go native extension
14
8
15
9
# Makes all symbols private by default to avoid unintended conflict
16
10
# with other gems. To explicitly export symbols you can use RUBY_FUNC_EXPORTED
17
11
# selectively, or entirely remove this flag.
18
12
append_cflags ( "-fvisibility=hidden" )
19
13
20
- create_makefile ( "example/example" )
21
-
22
14
############ Appended for go native extension
23
- case `#{ CONFIG [ "CC" ] } --version` # rubocop:disable Lint/LiteralAsCondition
24
- when /Free Software Foundation/
25
- ldflags = "-Wl,--unresolved-symbols=ignore-all"
26
- when /clang/
27
- ldflags = "-undefined dynamic_lookup"
28
- end
29
-
30
- current_dir = File . expand_path ( "." )
31
-
32
- File . open ( "Makefile" , "a" ) do |f |
33
- f . write <<~MAKEFILE . gsub ( /^ {8}/ , "\t " )
34
- $(DLLIB): Makefile $(srcdir)/*.go
35
- cd $(srcdir); \
36
- CGO_CFLAGS='$(INCFLAGS)' CGO_LDFLAGS='#{ ldflags } ' \
37
- go build -p 4 -buildmode=c-shared -o #{ current_dir } /$(DLLIB)
38
- MAKEFILE
39
- end
15
+ create_go_makefile ( "example/example" )
40
16
############ Appended for go native extension
You can’t perform that action at this time.
0 commit comments