This adds a new main command-line entry point for hdrgen, in the new main.py. This new interface is used for generating a header. The old ways of invoking yaml_to_classes.py for other purposes are left there for now, but `--e` is renamed to `--entry-point` for consistency with the new CLI. The YAML schema is expanded with the `header_template` key where the corresponding `.h.def` file's path is given relative to where the YAML file is found. The build integration no longer gives the `.h.def` path on the command line. Instead, the script now emits a depfile that's used by the cmake rules to track that. The output file is always explicit in the script command line rather than sometimes being derived from a directory path.
66 lines
1.2 KiB
YAML
66 lines
1.2 KiB
YAML
header: test_small.h
|
|
header_template: test_small.h.def
|
|
macros:
|
|
- macro_name: MACRO_A
|
|
macro_value: 1
|
|
- macro_name: MACRO_B
|
|
macro_value: 2
|
|
types:
|
|
- type_name: type_a
|
|
- type_name: type_b
|
|
enums:
|
|
- name: enum_a
|
|
value: value_1
|
|
- name: enum_b
|
|
value: value_2
|
|
objects:
|
|
- object_name: object_1
|
|
object_type: obj
|
|
- object_name: object_2
|
|
object_type: obj
|
|
functions:
|
|
- name: func_a
|
|
return_type: void
|
|
arguments: []
|
|
standards:
|
|
- stdc
|
|
attributes:
|
|
- CONST_FUNC_A
|
|
- name: func_b
|
|
return_type: float128
|
|
arguments: []
|
|
standards:
|
|
- stdc
|
|
guard: LIBC_TYPES_HAS_FLOAT128
|
|
- name: func_c
|
|
return_type: _Float16
|
|
arguments:
|
|
- type: int
|
|
- type: float
|
|
standards:
|
|
- stdc
|
|
guard: LIBC_TYPES_HAS_FLOAT16
|
|
- name: func_d
|
|
return_type: _Float16
|
|
arguments:
|
|
- type: int
|
|
- type: float
|
|
standards:
|
|
- stdc
|
|
guard: LIBC_TYPES_HAS_FLOAT16
|
|
- name: func_e
|
|
return_type: _Float16
|
|
arguments:
|
|
- type: float128
|
|
standards:
|
|
- stdc
|
|
guard: LIBC_TYPES_HAS_FLOAT16_AND_FLOAT128
|
|
- name: func_f
|
|
return_type: _Float16
|
|
arguments:
|
|
- type: int
|
|
- type: double
|
|
- type: float
|
|
standards:
|
|
- stdc
|