Skip to content

Latest commit

 

History

History
56 lines (40 loc) · 1.46 KB

File metadata and controls

56 lines (40 loc) · 1.46 KB

Mac OS X build


As with the Linux build, use CMake.

If you used Homebrew to install a supported version of OpenSSL, you need to tell CMake where to find it with OPENSSL_ROOT_DIR. You'll also need to tell the C compiler to add the openssl include path.

export OPENSSL_ROOT_DIR=`brew --prefix openssl`
export CFLAGS="-I$(brew --prefix openssl)/include"

OS X compilers treat uninitialized global variables as common symbols, which can be eliminated with the -fno-common compiler option.

export CFLAGS="${CFLAGS} -fno-common"

Initialize the CMake build normally:

cmake -S . -B DebugMacOSOpenSSL64

Then build:

cmake --build DebugMacOSOpenSSL64

Common Issues

You might encounter an error where the compiler can't locate the standard library headers:

fatal error: 'cstddef' file not found
   52 | #include <cstddef>
      |          ^~~~~~~~~
[  9%] Linking C static library libTpm_PlatformLib.a
1 error generated.

This may occur if the OS X developer command-line tools were upgraded from an older version. One workaround is to perform a clean reinstall of the OS X developer command line tools.

For more information see: nodejs/node#55023