mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
Add flags for Valgrind build
This commit is contained in:
@@ -253,11 +253,24 @@ option(USE_CUSTOM_LIBUV "Use Bun's recommended version of libuv (Windows only)"
|
||||
option(USE_CUSTOM_LSHPACK "Use Bun's recommended version of ls-hpack" ON)
|
||||
option(USE_BASELINE_BUILD "Build Bun for baseline (older) CPUs" OFF)
|
||||
|
||||
option(USE_VALGRIND "Build Bun with Valgrind support (Linux only)" OFF)
|
||||
|
||||
option(ZIG_OPTIMIZE "Optimization level for Zig" ${DEFAULT_ZIG_OPTIMIZE})
|
||||
option(USE_DEBUG_JSC "Enable assertions and use a debug build of JavaScriptCore" ${DEFAULT_USE_DEBUG_JSC})
|
||||
option(USE_UNIFIED_SOURCES "Use unified sources to speed up the build" OFF)
|
||||
option(USE_STATIC_LIBATOMIC "Statically link libatomic, requires the presence of libatomic.a" ${DEFAULT_USE_STATIC_LIBATOMIC})
|
||||
|
||||
if(USE_VALGRIND)
|
||||
# Disable SIMD
|
||||
set(USE_BASELINE_BUILD ON)
|
||||
|
||||
if(ARCH STREQUAL "x86_64")
|
||||
# This is for picohttpparser
|
||||
# Valgrind cannot handle SSE4.2 instructions
|
||||
add_compile_definitions("__SSE4_2__=0")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT CANARY)
|
||||
set(CANARY 0)
|
||||
endif()
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
"scripts": {
|
||||
"setup": "./scripts/setup.sh",
|
||||
"build": "if [ ! -e build ]; then bun setup; fi && ninja -C build",
|
||||
"build:valgrind": "cmake . -DZIG_OPTIMIZE=Debug -DUSE_DEBUG_JSC=ON -DCMAKE_BUILD_TYPE=Debug -GNinja -Bbuild-valgrind && ninja -Cbuild-valgrind",
|
||||
"build:release": "cmake . -DCMAKE_BUILD_TYPE=Release -GNinja -Bbuild-release && ninja -Cbuild-release",
|
||||
"build:safe": "cmake . -DZIG_OPTIMIZE=ReleaseSafe -DUSE_DEBUG_JSC=ON -DCMAKE_BUILD_TYPE=Release -GNinja -Bbuild-safe && ninja -Cbuild-safe",
|
||||
"typecheck": "tsc --noEmit && cd test && bun run typecheck",
|
||||
|
||||
@@ -18,6 +18,7 @@ cmake "${CMAKE_FLAGS[@]}" . \
|
||||
-DMI_BUILD_TESTS=OFF \
|
||||
-DMI_OSX_ZONE=OFF \
|
||||
-DMI_OSX_INTERPOSE=OFF \
|
||||
-DMI_TRACK_VALGRIND=ON \
|
||||
-DMI_BUILD_OBJECT=ON \
|
||||
-DMI_USE_CXX=ON \
|
||||
-DMI_OVERRIDE=OFF \
|
||||
|
||||
Reference in New Issue
Block a user