From f669af3a5cfbc5ce48df04f9be3da2b49a2d9862 Mon Sep 17 00:00:00 2001 From: R-Goc Date: Thu, 29 May 2025 00:04:33 -0600 Subject: [PATCH] LibGC: Add the minimum export macros required to link LibJS This approach still requires the WINDOWS_EXPORT_ALL_SYMBOLS target property, but it does let us run a lot more tests than before. --- Libraries/LibGC/CMakeLists.txt | 4 ++++ Libraries/LibGC/Internals.h | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Libraries/LibGC/CMakeLists.txt b/Libraries/LibGC/CMakeLists.txt index ee3201d9c61..eca1f64f1f6 100644 --- a/Libraries/LibGC/CMakeLists.txt +++ b/Libraries/LibGC/CMakeLists.txt @@ -23,3 +23,7 @@ if (ENABLE_SWIFT) target_link_libraries(LibGC PRIVATE AK) add_swift_target_properties(LibGC LAGOM_LIBRARIES AK) endif() + +# TODO: Use lagom_generate_export_header and annotate entire LibGC with export macros +include(GenerateExportHeader) +generate_export_header(LibGC EXPORT_MACRO_NAME GC_API EXPORT_FILE_NAME "Export.h") diff --git a/Libraries/LibGC/Internals.h b/Libraries/LibGC/Internals.h index 234c33baf40..a6327491a6f 100644 --- a/Libraries/LibGC/Internals.h +++ b/Libraries/LibGC/Internals.h @@ -8,6 +8,7 @@ #pragma once #include +#include #include namespace GC { @@ -33,7 +34,7 @@ class HeapBlockBase { AK_MAKE_NONCOPYABLE(HeapBlockBase); public: - static size_t block_size; + GC_API static size_t block_size; static HeapBlockBase* from_cell(Cell const* cell) { return reinterpret_cast(bit_cast(cell) & ~(HeapBlockBase::block_size - 1));