From 5ceef13e2336dfa1c4de8fdb3a273d81add0a7ca Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Wed, 19 Feb 2025 15:51:22 +0800 Subject: Fix and document static build (#6374) * Set static stbi flag for static builds * Add missing SYSTEM directive for external includes * Add instructions for linking statically against slang --------- Co-authored-by: Yong He --- docs/building.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'docs/building.md') diff --git a/docs/building.md b/docs/building.md index 21a86b03b..504e4e10c 100644 --- a/docs/building.md +++ b/docs/building.md @@ -321,6 +321,21 @@ cmake -B build -G Ninja cmake --build build -j ``` +## Static linking against libslang + +If linking against a static `libslang.a` you will need to link against some +dependencies also if you're not already incorporating them into your project. + +You will need to link against: + +``` +${SLANG_DIR}/build/Release/lib/libslang.a +${SLANG_DIR}/build/Release/lib/libcompiler-core.a +${SLANG_DIR}/build/Release/lib/libcore.a +${SLANG_DIR}/build/external/miniz/libminiz.a +${SLANG_DIR}/build/external/lz4/build/cmake/liblz4.a +``` + ## Notes [^1] below 3.25, CMake lacks the ability to mark directories as being -- cgit v1.2.3