mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
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>
32 lines
1.1 KiB
CMake
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")
|