Skip to content

declare allows initializer, but ignores it #118

Description

@cspiel

OMake allows a declare instruction to take an
initializer, but silently ignores it. The
documentation (see Section 5.7) does not
mention this "extension".

declare public.X = init

#  Uncomment the next line to force "unbound variable: ..." error.
#println($"+ X = <$(public.X)>")

public.X = assign
println($"+ X = <$(public.X)>")

IMHO it would be preferable to have a warning in
such cases, like, e.g. "initialization ignored".

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