Skip to content

Commit 7e10776

Browse files
skatkovStanislav (Stas) Katkov
andauthored
Use append_cflags instead of modifying CFLAGS directly (#137)
Co-authored-by: Stanislav (Stas) Katkov <git@skatkov.com>
1 parent f6095fe commit 7e10776

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

ext/extconf.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414

1515
# dir_config(extension_name)
1616

17-
$CFLAGS << " -Wall -Wno-unknown-pragmas -std=c99"
17+
append_cflags(["-Wall", "-Wno-unknown-pragmas", "-std=c99"])
1818

1919
if ENV.key?("RUBY_DEBUG")
2020
$stderr.puts "Enabling debug mode..."
21-
22-
$CFLAGS << " -DRUBY_DEBUG -O0"
21+
22+
append_cflags(["-DRUBY_DEBUG", "-O0"])
2323
end
2424

2525
$srcs = ["io/event/event.c", "io/event/time.c", "io/event/fiber.c", "io/event/selector/selector.c"]
@@ -32,7 +32,7 @@
3232
if have_library("uring") and have_header("liburing.h")
3333
# We might want to consider using this in the future:
3434
# have_func("io_uring_submit_and_wait_timeout", "liburing.h")
35-
35+
3636
$srcs << "io/event/selector/uring.c"
3737
end
3838

@@ -59,9 +59,9 @@
5959

6060
if ENV.key?("RUBY_SANITIZE")
6161
$stderr.puts "Enabling sanitizers..."
62-
62+
6363
# Add address and undefined behaviour sanitizers:
64-
$CFLAGS << " -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer"
64+
append_cflags(["-fsanitize=address", "-fsanitize=undefined", "-fno-omit-frame-pointer"])
6565
$LDFLAGS << " -fsanitize=address -fsanitize=undefined"
6666
end
6767

0 commit comments

Comments
 (0)