+14
-2
lines changedFilter options
+14
-2
lines changed Original file line number Diff line number Diff line change
@@ -89,6 +89,14 @@ Then build the Gem:
89
89
$ rake clobber_package gem
90
90
$ gem install `ls pkg/google-protobuf-*.gem`
91
91
92
+
If you intend to debug the protobuf_c Ruby bindings with `gdb`, you can also
93
+
build a version with debug symbols enabled by setting the `PROTOBUF_CONFIG`
94
+
enviroment variable when you build the native extension:
95
+
96
+
```
97
+
$ PROTOBUF_CONFIG=dbg rake
98
+
```
99
+
92
100
To run the specs:
93
101
94
102
$ rake test
Original file line number Diff line number Diff line change
@@ -18,10 +18,14 @@
18
18
RbConfig::CONFIG["LD"] = RbConfig::MAKEFILE_CONFIG["LD"] = ENV["LD"]
19
19
end
20
20
21
+
debug_enabled = ENV["PROTOBUF_CONFIG"] == "dbg"
22
+
23
+
additional_c_flags = debug_enabled ? "-O0 -fno-omit-frame-pointer -fvisibility=default -g" : "-O3 -DNDEBUG -fvisibility=hidden"
24
+
21
25
if RUBY_PLATFORM =~ /darwin/ || RUBY_PLATFORM =~ /linux/ || RUBY_PLATFORM =~ /freebsd/
22
-
$CFLAGS += " -std=gnu99 -O3 -DNDEBUG -fvisibility=hidden -Wall -Wsign-compare -Wno-declaration-after-statement"
26
+
$CFLAGS += " -std=gnu99 -Wall -Wsign-compare -Wno-declaration-after-statement #{additional_c_flags}"
23
27
else
24
-
$CFLAGS += " -std=gnu99 -O3 -DNDEBUG"
28
+
$CFLAGS += " -std=gnu99 #{additional_c_flags}"
25
29
end
26
30
27
31
if RUBY_PLATFORM =~ /linux/
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4