fix: resolve lbug includes correctly in monorepo builds#13
Merged
Conversation
The standalone precompiled-liblbug support added in fbeac16 changed the imported lbug target to default its include directories from PROJECT_SOURCE_DIR/PROJECT_BINARY_DIR. That works when this repo is configured standalone, but breaks when tools/nodejs_api is built from the Ladybug monorepo because PROJECT_SOURCE_DIR points at the addon directory rather than the top-level Ladybug tree. In CI this produced a non-existent tools/nodejs_api/src/include path and CMake failed during generate. Fix the imported-target path resolution to prefer explicit LBUG_SOURCE_DIR/LBUG_BUILD_DIR overrides, then fall back to the embedding monorepo source/build directories, and only then to the standalone sibling layout when those directories actually exist. Also fail with a clear error if no valid Ladybug source or generated include tree can be found.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The standalone precompiled-liblbug support added in fbeac16 changed the imported lbug target to default its include directories from PROJECT_SOURCE_DIR/PROJECT_BINARY_DIR. That works when this repo is configured standalone, but breaks when tools/nodejs_api is built from the Ladybug monorepo because PROJECT_SOURCE_DIR points at the addon directory rather than the top-level Ladybug tree. In CI this produced a non-existent tools/nodejs_api/src/include path and CMake failed during generate.
Fix the imported-target path resolution to prefer explicit LBUG_SOURCE_DIR/LBUG_BUILD_DIR overrides, then fall back to the embedding monorepo source/build directories, and only then to the standalone sibling layout when those directories actually exist. Also fail with a clear error if no valid Ladybug source or generated include tree can be found.