Skip to content

Commit

Permalink
Darwin build improvements (#406)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: Ranieri Althoff <[email protected]>
  • Loading branch information
Torrekie and ranisalt authored Sep 25, 2024
1 parent 0098ce2 commit f37b734
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,19 @@
"configurations": {
"Release": {
"target_conditions": [
["OS != 'win'", {
["OS not in 'ios mac'", {
# Avoid defining _FORTIFY_SOURCE on Darwin
"defines+": ["_FORTIFY_SOURCE=2"]
}],
["OS not in 'win ios mac'", {
# On Darwin with Xcode CLT/LLVM, "-fvisibility=hidden" hide all symbols that
# not explicitly marked with __attribute__((visibility("default")))
# Flags for sections are specific to ELF binaries
"cflags+": ["-fdata-sections", "-ffunction-sections", "-fvisibility=hidden"],
"ldflags+": ["-Wl,--gc-sections"]
}]
],
"defines+": ["_FORTIFY_SOURCE=2", "NDEBUG"]
"defines+": ["NDEBUG"]
}
}
},
Expand Down Expand Up @@ -58,7 +65,7 @@
"sources": [
"argon2.cpp"
],
"cflags_cc+": ["-Wall", "-Wextra", "-Wformat", "-Wnon-virtual-dtor", "-pedantic", "-Werror"],
"cflags_cc+": ["-Wall", "-Wextra", "-Wformat", "-Wnon-virtual-dtor", "-pedantic", "-Werror", "-fexceptions"],
"cflags_cc!": ["-fno-exceptions"],
"include_dirs": ["<!(node -p \"require('node-addon-api').include_dir\")"],
"dependencies": ["libargon2"],
Expand Down

0 comments on commit f37b734

Please sign in to comment.