Skip to content

Commit

Permalink
Merge pull request #109 from liu-kan/master
Browse files Browse the repository at this point in the history
Building process will be broken if add -latomic in Mac with Clang.
  • Loading branch information
codypiersall committed Nov 19, 2022
2 parents 945a319 + fd69c6b commit 8b79d6b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
Binary file removed .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,3 +1,4 @@
.DS_Store
*~
*.o
*.so
Expand Down
13 changes: 11 additions & 2 deletions build_pynng.py
Expand Up @@ -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

WINDOWS = sys.platform == 'win32'
Expand Down Expand Up @@ -35,7 +35,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')


Expand Down

0 comments on commit 8b79d6b

Please sign in to comment.