Files
bun.sh/cmake/scripts/PrepareNodeHeaders.cmake
190n 172aecb02e [publish images] Upgrade self-reported Node.js version from 22.6.0 to 24.3.0 (v2) (#20772)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Jarred-Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Meghan Denny <meghan@bun.sh>
Co-authored-by: Ashcon Partovi <ashcon@partovi.net>
Co-authored-by: pfg <pfg@pfg.pw>
Co-authored-by: pfgithub <6010774+pfgithub@users.noreply.github.com>
Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-07-02 12:06:08 -07:00

32 lines
1.1 KiB
CMake

# This script prepares Node.js headers for use with Bun
# It removes conflicting OpenSSL and libuv headers since Bun uses BoringSSL and its own libuv
if(NOT DEFINED NODE_INCLUDE_DIR)
message(FATAL_ERROR "NODE_INCLUDE_DIR not defined")
endif()
if(NOT EXISTS "${NODE_INCLUDE_DIR}/node")
message(FATAL_ERROR "Node headers not found at ${NODE_INCLUDE_DIR}/node")
endif()
# Remove OpenSSL headers that conflict with BoringSSL
if(EXISTS "${NODE_INCLUDE_DIR}/node/openssl")
file(REMOVE_RECURSE "${NODE_INCLUDE_DIR}/node/openssl")
message(STATUS "Removed conflicting OpenSSL headers")
endif()
# Remove libuv headers that might conflict
if(EXISTS "${NODE_INCLUDE_DIR}/node/uv")
file(REMOVE_RECURSE "${NODE_INCLUDE_DIR}/node/uv")
message(STATUS "Removed conflicting libuv headers")
endif()
if(EXISTS "${NODE_INCLUDE_DIR}/node/uv.h")
file(REMOVE "${NODE_INCLUDE_DIR}/node/uv.h")
message(STATUS "Removed conflicting uv.h header")
endif()
# Add the node directory to include path for cppgc
# This is needed because cppgc internal headers use relative includes
file(WRITE "${NODE_INCLUDE_DIR}/.node-headers-prepared" "1")