serialport / bindings-cpp

The C++ bindings for the node serialport project.
MIT License
22 stars 43 forks source link

Unsupported architecture for MacOS #99

Open GlaceCoding opened 1 year ago

GlaceCoding commented 1 year ago

SerialPort Bindings Version

10.8.0

Node Version

v16.14.2

Electron Version

No response

Platform

Darwin 18.5.0 /RELEASE_X86_64 x86_64

Architecture

No response

Hardware or chipset of serialport

No response

What steps will reproduce the bug?

I tried to build my own build of bindings cpp with:

npm run rebuild

What happens?

Fatal error during build fatal error: too many errors emitted, stopping now

gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  CXX(target) Release/obj.target/bindings/src/serialport.o
In file included from ../src/serialport.cpp:1:
In file included from ../src/./serialport.h:11:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/stdio.h:108:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/stdio.h:64:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/_stdio.h:68:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/sys/cdefs.h:784:2: error:
      Unsupported architecture
#error Unsupported architecture

/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/sys/cdefs.h:784:2 :

/*
 * Architecture validation for current SDK
 */
#if !defined(__sys_cdefs_arch_unknown__) && defined(__i386__)
#elif !defined(__sys_cdefs_arch_unknown__) && defined(__x86_64__)
#else
#error Unsupported architecture // <=== line 784
#endif

It seems that miss some flag.

What should have happened?

Build should be done

Additional information

I was able to fix it and correctly build, when I change 'OTHER_CFLAGS' to 'CFLAGS' and I do the same for OTHER_LDFLAGS. I was asking my self it is really 'OTHER_CFLAGS' that you want to do ?

https://github.com/serialport/bindings-cpp/blob/abba8947ea2b21ee1dc41a8064710bbd9025c3ec/binding.gyp#L36-L45