Skip to content

Commit

Permalink
Fix the bug that building process will be broken if add -latomic in M…
Browse files Browse the repository at this point in the history
…ac with clang. nodejs/node#30099
  • Loading branch information
liu-kan committed Aug 21, 2022
1 parent 9dfc361 commit a961fcb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Binary file modified .DS_Store
Binary file not shown.
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

ffibuilder = FFI()
Expand All @@ -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')


Expand Down

0 comments on commit a961fcb

Please sign in to comment.