Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,27 @@ set_target_properties(_lbug
RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/build/ladybug"
ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/build/ladybug")

target_link_libraries(_lbug
PRIVATE
lbug)
if(LBUG_API_USE_PRECOMPILED_LIB)
if(NOT LBUG_API_PRECOMPILED_LIB_PATH)
message(FATAL_ERROR "LBUG_API_PRECOMPILED_LIB_PATH must be set when LBUG_API_USE_PRECOMPILED_LIB is enabled.")
endif()
target_link_libraries(_lbug
PRIVATE
${LBUG_API_PRECOMPILED_LIB_PATH}
# lbug_link_deps carries all third-party static libs (utf8proc, re2,
# antlr4, zstd, …) that lbug.lib references but does not bundle on
# Windows. On Linux/macOS the precompiled liblbug.a is a fat archive
# with those objects already merged in, so this is a no-op there.
lbug_link_deps)
# The precompiled lib is always a static archive. Without LBUG_STATIC_DEFINE,
# api.h decorates every LBUG_API symbol with __declspec(dllimport) on Windows,
# which causes LNK2001 unresolved-symbol errors because no DLL is present.
target_compile_definitions(_lbug PRIVATE LBUG_STATIC_DEFINE)
else()
target_link_libraries(_lbug
PRIVATE
lbug)
endif()

target_include_directories(
_lbug
Expand Down
Loading