Skip to content

ly_config.h.in: LY_SRC_DIR embeds build path in installed public header #2553

Description

@guna-120601

LY_SRC_DIR is defined in src/ly_config.h.in as:

#define LY_SRC_DIR "@CMAKE_CURRENT_SOURCE_DIR@"

This embeds the build-time source directory path into the installed public header (ly_config.h), which causes build path QA errors in cross-compilation environments like Yocto/OpenEmbedded.

LY_SRC_DIR is only referenced by tests and fuzzers:

tests/perf/perf.c
tests/fuzz/yang_parse_module.c
tests/fuzz/lys_parse_mem.c
tests/fuzz/lyd_parse_mem_xml.c
tests/fuzz/lyd_parse_mem_json.c
No library source code uses LY_SRC_DIR.

Suggestion: Move LY_SRC_DIR to a separate test-only config header so it is not included in the installed public header.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions