[MacRuby-devel] Compiling with debug information

Marc Abramowitz msabramo at gmail.com
Mon Feb 20 07:37:39 PST 2012


I might be missing something obvious here.

I want to be able to build MacRuby with debug information by tweaking the
command-line instead of the code itself (which is what I had been doing
until now). Something like:

[last: 41] marca at SCML-MarcA:~/dev/git-repos/MacRuby$
CFLAGS="-DROXOR_VM_DEBUG" rake
(in /Users/marca/dev/git-repos/MacRuby)
/usr/bin/g++ -I. -I./include -fblocks -g -Wall -Wno-deprecated-declarations
-Werror -arch x86_64 -DROXOR_VM_DEBUG -I/usr/local/include  -D_DEBUG
-D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -O3
-fno-rtti -fno-common -Woverloaded-virtual -I./icu-1060 -c vm.cpp -o
.objs/vm.o
vm.cpp:9:1: error: "ROXOR_VM_DEBUG" redefined
<command-line>: error: this is the location of the previous definition
rake aborted!
Command failed with status (1): [/usr/bin/g++ -I. -I./include -fblocks -g
-...]

(See full trace by running task with --trace)

This fails because vm.cpp has:

#define ROXOR_VM_DEBUG 0

I could fix this by changing that to:

#ifndef ROXOR_VM_DEBUG
#define ROXOR_VM_DEBUG 0
#endif

but the fact that it's not already there makes me think that people have
another, easier way to switch compile flags.

If there's an easier way, please let me know what it is and if there's not,
should I send a pull request that wraps all the #defines in #ifndefs?

Marc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-devel/attachments/20120220/ba21f056/attachment.html>


More information about the MacRuby-devel mailing list