diff --git a/binding.gyp b/binding.gyp index 44c7374..511a747 100644 --- a/binding.gyp +++ b/binding.gyp @@ -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"] } } }, @@ -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": ["