diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 92970a5..0000000 Binary files a/.DS_Store and /dev/null differ diff --git a/.gitignore b/.gitignore index f0e90f0..5678cae 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.DS_Store *~ *.o *.so diff --git a/build_pynng.py b/build_pynng.py index 3215129..45e620c 100644 --- a/build_pynng.py +++ b/build_pynng.py @@ -4,7 +4,7 @@ # script should ensure that it is built before running. It looks in this file # to see what the expected object file is based on the platform. from cffi import FFI -import os +import os,sysconfig import sys ffibuilder = FFI() @@ -28,7 +28,16 @@ machine = os.uname().machine # this is a pretty heuristic... but let's go with it anyway. # it would be better to get linker information from cmake somehow. - if not ('x86' in machine or 'i386' in machine or 'i686' in machine): + # Building process will be broken if add -latomic in Mac with clang. https://github.com/nodejs/node/pull/30099 + clang = False + try: + if os.environ['CC'] == "clang": + clang = True + except KeyError: + clang = False + if sysconfig.get_config_var('CC') == 'clang': + clang = True + if not ('x86' in machine or 'i386' in machine or 'i686' in machine or (clang and 'Darwin' in os.uname().sysname)): libraries.append('atomic')