Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building process will be broken if add -latomic in Mac with Clang. #109

Merged
merged 4 commits into from Nov 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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

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