mirror of
https://github.com/oven-sh/bun
synced 2026-02-15 05:12:29 +00:00
Add precompiled header (#18321)
This commit is contained in:
@@ -747,6 +747,18 @@ set_target_properties(${bun} PROPERTIES
|
||||
VISIBILITY_INLINES_HIDDEN YES
|
||||
)
|
||||
|
||||
if (NOT WIN32)
|
||||
# Enable precompiled headers
|
||||
# Only enable in these scenarios:
|
||||
# 1. NOT in CI, OR
|
||||
# 2. In CI AND BUN_CPP_ONLY is enabled
|
||||
if(NOT CI OR (CI AND BUN_CPP_ONLY))
|
||||
target_precompile_headers(${bun} PRIVATE
|
||||
"$<$<COMPILE_LANGUAGE:CXX>:${CWD}/src/bun.js/bindings/root.h>"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# --- C/C++ Includes ---
|
||||
|
||||
if(WIN32)
|
||||
@@ -901,6 +913,10 @@ if(NOT WIN32)
|
||||
-Werror
|
||||
)
|
||||
endif()
|
||||
else()
|
||||
target_compile_options(${bun} PUBLIC
|
||||
-Wno-nullability-completeness
|
||||
)
|
||||
endif()
|
||||
|
||||
# --- Linker options ---
|
||||
|
||||
@@ -87,9 +87,6 @@ public:
|
||||
|
||||
private:
|
||||
Expected<void, Exception> m_value;
|
||||
#if ASSERT_ENABLED
|
||||
bool m_wasReleased { false };
|
||||
#endif
|
||||
};
|
||||
|
||||
ExceptionOr<void> isolatedCopy(ExceptionOr<void>&&);
|
||||
|
||||
@@ -76,6 +76,8 @@
|
||||
#include <wtf/text/MakeString.h>
|
||||
#include <JavaScriptCore/JSCInlines.h>
|
||||
#include <JavaScriptCore/HandleSet.h>
|
||||
#include <wtf/Ref.h>
|
||||
#include <wtf/ThreadSafeRefCounted.h>
|
||||
|
||||
#define ENABLE_WEB_CRYPTO 1
|
||||
#define USE_OPENSSL 1
|
||||
|
||||
@@ -34,8 +34,8 @@ enum class SideEffectType {
|
||||
// (v8-fast-api-calls.h is not in the headers distribution)
|
||||
class CFunction {
|
||||
private:
|
||||
const void* address;
|
||||
const void* type_info;
|
||||
[[maybe_unused]] const void* address;
|
||||
[[maybe_unused]] const void* type_info;
|
||||
};
|
||||
|
||||
class FunctionTemplate : public Template {
|
||||
|
||||
@@ -98,9 +98,9 @@ private:
|
||||
RefPtr<TouchList> m_targetTouches;
|
||||
RefPtr<TouchList> m_changedTouches;
|
||||
#endif
|
||||
int m_closedShadowDepth { 0 };
|
||||
bool m_currentTargetIsInShadowTree { false };
|
||||
bool m_contextNodeIsFormElement { false };
|
||||
[[maybe_unused]] int m_closedShadowDepth { 0 };
|
||||
[[maybe_unused]] bool m_currentTargetIsInShadowTree { false };
|
||||
[[maybe_unused]] bool m_contextNodeIsFormElement { false };
|
||||
Type m_type { Type::Normal };
|
||||
};
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ private:
|
||||
EventNames(); // Private to prevent accidental call to EventNames() instead of eventNames().
|
||||
// friend class ThreadGlobalData; // Allow ThreadGlobalData to create the per-thread EventNames object.
|
||||
|
||||
int dummy; // Needed to make initialization macro work.
|
||||
[[maybe_unused]] int dummy; // Needed to make initialization macro work.
|
||||
};
|
||||
|
||||
const EventNames& eventNames();
|
||||
|
||||
@@ -137,7 +137,6 @@ private:
|
||||
Deque<RefPtr<Event>> m_pendingEvents;
|
||||
Lock m_pendingTasksMutex;
|
||||
Deque<Function<void(ScriptExecutionContext&)>> m_pendingTasks;
|
||||
bool m_didStartWorkerGlobalScope { false };
|
||||
// Tracks OnlineFlag and ClosingFlag
|
||||
std::atomic<uint8_t> m_onlineClosingFlags { 0 };
|
||||
// Tracks TerminateRequestedFlag and TerminatedFlag
|
||||
|
||||
@@ -595,7 +595,7 @@ JSBuiltinInternalFunctions::JSBuiltinInternalFunctions(JSC::VM& vm) : m_vm(vm)
|
||||
void exportNames();
|
||||
|
||||
private:
|
||||
JSC::VM& m_vm;
|
||||
[[maybe_unused]] JSC::VM& m_vm;
|
||||
|
||||
WEBCORE_FOREACH_${basename.toUpperCase()}_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
|
||||
|
||||
@@ -638,7 +638,7 @@ JSBuiltinInternalFunctions::JSBuiltinInternalFunctions(JSC::VM& vm) : m_vm(vm)
|
||||
template<typename Visitor> void visit(Visitor&);
|
||||
|
||||
public:
|
||||
JSC::VM& m_vm;
|
||||
[[maybe_unused]] JSC::VM& m_vm;
|
||||
|
||||
#define DECLARE_BUILTIN_SOURCE_MEMBERS(functionName) \\
|
||||
JSC::WriteBarrier<JSC::JSFunction> m_##functionName##Function;
|
||||
@@ -682,7 +682,7 @@ JSBuiltinInternalFunctions::JSBuiltinInternalFunctions(JSC::VM& vm) : m_vm(vm)
|
||||
|
||||
bundledHeader += `
|
||||
private:
|
||||
JSC::VM& m_vm;
|
||||
[[maybe_unused]] JSC::VM& m_vm;
|
||||
`;
|
||||
|
||||
for (const { basename } of files) {
|
||||
@@ -708,7 +708,7 @@ JSBuiltinInternalFunctions::JSBuiltinInternalFunctions(JSC::VM& vm) : m_vm(vm)
|
||||
|
||||
bundledHeader += `
|
||||
private:
|
||||
JSC::VM& m_vm;
|
||||
[[maybe_unused]] JSC::VM& m_vm;
|
||||
`;
|
||||
|
||||
for (const { basename, internal } of files) {
|
||||
|
||||
Reference in New Issue
Block a user