Skip to content

Commit 4c8334b

Browse files
committed
Add build files and generator script
Adds a `generate_build_files.py` script that is used to generate build files for use in bazel, cmake, and GN. Additionally a clean json file is added for more generic usage. These files are intended to be included in downstream build systems to explicitly list out the files required by embossc and the C++ runtime. The generated build files are included as well.
1 parent 666402b commit 4c8334b

File tree

5 files changed

+443
-0
lines changed

5 files changed

+443
-0
lines changed

gen/sources.bzl

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
16+
# Automatically generated by generate_build_files.py.
17+
# Do not edit this file directly.
18+
19+
EMBOSSC_SOURCES = [
20+
"compiler/__init__.py",
21+
"compiler/back_end/__init__.py",
22+
"compiler/back_end/cpp/__init__.py",
23+
"compiler/back_end/cpp/attributes.py",
24+
"compiler/back_end/cpp/emboss_codegen_cpp.py",
25+
"compiler/back_end/cpp/generated_code_templates",
26+
"compiler/back_end/cpp/header_generator.py",
27+
"compiler/back_end/util/__init__.py",
28+
"compiler/back_end/util/code_template.py",
29+
"compiler/front_end/__init__.py",
30+
"compiler/front_end/attribute_checker.py",
31+
"compiler/front_end/attributes.py",
32+
"compiler/front_end/constraints.py",
33+
"compiler/front_end/dependency_checker.py",
34+
"compiler/front_end/emboss_front_end.py",
35+
"compiler/front_end/error_examples",
36+
"compiler/front_end/expression_bounds.py",
37+
"compiler/front_end/generated/cached_parser.py",
38+
"compiler/front_end/glue.py",
39+
"compiler/front_end/lr1.py",
40+
"compiler/front_end/make_parser.py",
41+
"compiler/front_end/module_ir.py",
42+
"compiler/front_end/parser.py",
43+
"compiler/front_end/prelude.emb",
44+
"compiler/front_end/reserved_words",
45+
"compiler/front_end/symbol_resolver.py",
46+
"compiler/front_end/synthetics.py",
47+
"compiler/front_end/tokenizer.py",
48+
"compiler/front_end/type_check.py",
49+
"compiler/front_end/write_inference.py",
50+
"compiler/util/__init__.py",
51+
"compiler/util/attribute_util.py",
52+
"compiler/util/error.py",
53+
"compiler/util/expression_parser.py",
54+
"compiler/util/ir_data.py",
55+
"compiler/util/ir_data_fields.py",
56+
"compiler/util/ir_data_utils.py",
57+
"compiler/util/ir_util.py",
58+
"compiler/util/name_conversion.py",
59+
"compiler/util/parser_types.py",
60+
"compiler/util/parser_util.py",
61+
"compiler/util/resources.py",
62+
"compiler/util/simple_memoizer.py",
63+
"compiler/util/traverse_ir.py",
64+
"embossc",
65+
]
66+
67+
EMBOSS_RUNTIME_CPP_SOURCES = [
68+
"runtime/cpp/emboss_arithmetic.h",
69+
"runtime/cpp/emboss_arithmetic_all_known_generated.h",
70+
"runtime/cpp/emboss_arithmetic_maximum_operation_generated.h",
71+
"runtime/cpp/emboss_array_view.h",
72+
"runtime/cpp/emboss_bit_util.h",
73+
"runtime/cpp/emboss_constant_view.h",
74+
"runtime/cpp/emboss_cpp_types.h",
75+
"runtime/cpp/emboss_cpp_util.h",
76+
"runtime/cpp/emboss_defines.h",
77+
"runtime/cpp/emboss_enum_view.h",
78+
"runtime/cpp/emboss_maybe.h",
79+
"runtime/cpp/emboss_memory_util.h",
80+
"runtime/cpp/emboss_prelude.h",
81+
"runtime/cpp/emboss_text_util.h",
82+
"runtime/cpp/emboss_view_parameters.h",
83+
]

gen/sources.cmake

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
16+
# Automatically generated by generate_build_files.py.
17+
# Do not edit this file directly.
18+
19+
set(EMBOSSC_SOURCES
20+
"compiler/__init__.py"
21+
"compiler/back_end/__init__.py"
22+
"compiler/back_end/cpp/__init__.py"
23+
"compiler/back_end/cpp/attributes.py"
24+
"compiler/back_end/cpp/emboss_codegen_cpp.py"
25+
"compiler/back_end/cpp/generated_code_templates"
26+
"compiler/back_end/cpp/header_generator.py"
27+
"compiler/back_end/util/__init__.py"
28+
"compiler/back_end/util/code_template.py"
29+
"compiler/front_end/__init__.py"
30+
"compiler/front_end/attribute_checker.py"
31+
"compiler/front_end/attributes.py"
32+
"compiler/front_end/constraints.py"
33+
"compiler/front_end/dependency_checker.py"
34+
"compiler/front_end/emboss_front_end.py"
35+
"compiler/front_end/error_examples"
36+
"compiler/front_end/expression_bounds.py"
37+
"compiler/front_end/generated/cached_parser.py"
38+
"compiler/front_end/glue.py"
39+
"compiler/front_end/lr1.py"
40+
"compiler/front_end/make_parser.py"
41+
"compiler/front_end/module_ir.py"
42+
"compiler/front_end/parser.py"
43+
"compiler/front_end/prelude.emb"
44+
"compiler/front_end/reserved_words"
45+
"compiler/front_end/symbol_resolver.py"
46+
"compiler/front_end/synthetics.py"
47+
"compiler/front_end/tokenizer.py"
48+
"compiler/front_end/type_check.py"
49+
"compiler/front_end/write_inference.py"
50+
"compiler/util/__init__.py"
51+
"compiler/util/attribute_util.py"
52+
"compiler/util/error.py"
53+
"compiler/util/expression_parser.py"
54+
"compiler/util/ir_data.py"
55+
"compiler/util/ir_data_fields.py"
56+
"compiler/util/ir_data_utils.py"
57+
"compiler/util/ir_util.py"
58+
"compiler/util/name_conversion.py"
59+
"compiler/util/parser_types.py"
60+
"compiler/util/parser_util.py"
61+
"compiler/util/resources.py"
62+
"compiler/util/simple_memoizer.py"
63+
"compiler/util/traverse_ir.py"
64+
"embossc"
65+
)
66+
67+
set(EMBOSS_RUNTIME_CPP_SOURCES
68+
"runtime/cpp/emboss_arithmetic.h"
69+
"runtime/cpp/emboss_arithmetic_all_known_generated.h"
70+
"runtime/cpp/emboss_arithmetic_maximum_operation_generated.h"
71+
"runtime/cpp/emboss_array_view.h"
72+
"runtime/cpp/emboss_bit_util.h"
73+
"runtime/cpp/emboss_constant_view.h"
74+
"runtime/cpp/emboss_cpp_types.h"
75+
"runtime/cpp/emboss_cpp_util.h"
76+
"runtime/cpp/emboss_defines.h"
77+
"runtime/cpp/emboss_enum_view.h"
78+
"runtime/cpp/emboss_maybe.h"
79+
"runtime/cpp/emboss_memory_util.h"
80+
"runtime/cpp/emboss_prelude.h"
81+
"runtime/cpp/emboss_text_util.h"
82+
"runtime/cpp/emboss_view_parameters.h"
83+
)

gen/sources.gni

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
16+
# Automatically generated by generate_build_files.py.
17+
# Do not edit this file directly.
18+
19+
embossc_sources = [
20+
"compiler/__init__.py",
21+
"compiler/back_end/__init__.py",
22+
"compiler/back_end/cpp/__init__.py",
23+
"compiler/back_end/cpp/attributes.py",
24+
"compiler/back_end/cpp/emboss_codegen_cpp.py",
25+
"compiler/back_end/cpp/generated_code_templates",
26+
"compiler/back_end/cpp/header_generator.py",
27+
"compiler/back_end/util/__init__.py",
28+
"compiler/back_end/util/code_template.py",
29+
"compiler/front_end/__init__.py",
30+
"compiler/front_end/attribute_checker.py",
31+
"compiler/front_end/attributes.py",
32+
"compiler/front_end/constraints.py",
33+
"compiler/front_end/dependency_checker.py",
34+
"compiler/front_end/emboss_front_end.py",
35+
"compiler/front_end/error_examples",
36+
"compiler/front_end/expression_bounds.py",
37+
"compiler/front_end/generated/cached_parser.py",
38+
"compiler/front_end/glue.py",
39+
"compiler/front_end/lr1.py",
40+
"compiler/front_end/make_parser.py",
41+
"compiler/front_end/module_ir.py",
42+
"compiler/front_end/parser.py",
43+
"compiler/front_end/prelude.emb",
44+
"compiler/front_end/reserved_words",
45+
"compiler/front_end/symbol_resolver.py",
46+
"compiler/front_end/synthetics.py",
47+
"compiler/front_end/tokenizer.py",
48+
"compiler/front_end/type_check.py",
49+
"compiler/front_end/write_inference.py",
50+
"compiler/util/__init__.py",
51+
"compiler/util/attribute_util.py",
52+
"compiler/util/error.py",
53+
"compiler/util/expression_parser.py",
54+
"compiler/util/ir_data.py",
55+
"compiler/util/ir_data_fields.py",
56+
"compiler/util/ir_data_utils.py",
57+
"compiler/util/ir_util.py",
58+
"compiler/util/name_conversion.py",
59+
"compiler/util/parser_types.py",
60+
"compiler/util/parser_util.py",
61+
"compiler/util/resources.py",
62+
"compiler/util/simple_memoizer.py",
63+
"compiler/util/traverse_ir.py",
64+
"embossc",
65+
]
66+
67+
emboss_runtime_cpp_sources = [
68+
"runtime/cpp/emboss_arithmetic.h",
69+
"runtime/cpp/emboss_arithmetic_all_known_generated.h",
70+
"runtime/cpp/emboss_arithmetic_maximum_operation_generated.h",
71+
"runtime/cpp/emboss_array_view.h",
72+
"runtime/cpp/emboss_bit_util.h",
73+
"runtime/cpp/emboss_constant_view.h",
74+
"runtime/cpp/emboss_cpp_types.h",
75+
"runtime/cpp/emboss_cpp_util.h",
76+
"runtime/cpp/emboss_defines.h",
77+
"runtime/cpp/emboss_enum_view.h",
78+
"runtime/cpp/emboss_maybe.h",
79+
"runtime/cpp/emboss_memory_util.h",
80+
"runtime/cpp/emboss_prelude.h",
81+
"runtime/cpp/emboss_text_util.h",
82+
"runtime/cpp/emboss_view_parameters.h",
83+
]

gen/sources.json

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{
2+
"embossc_sources": [
3+
"compiler/__init__.py",
4+
"compiler/back_end/__init__.py",
5+
"compiler/back_end/cpp/__init__.py",
6+
"compiler/back_end/cpp/attributes.py",
7+
"compiler/back_end/cpp/emboss_codegen_cpp.py",
8+
"compiler/back_end/cpp/generated_code_templates",
9+
"compiler/back_end/cpp/header_generator.py",
10+
"compiler/back_end/util/__init__.py",
11+
"compiler/back_end/util/code_template.py",
12+
"compiler/front_end/__init__.py",
13+
"compiler/front_end/attribute_checker.py",
14+
"compiler/front_end/attributes.py",
15+
"compiler/front_end/constraints.py",
16+
"compiler/front_end/dependency_checker.py",
17+
"compiler/front_end/emboss_front_end.py",
18+
"compiler/front_end/error_examples",
19+
"compiler/front_end/expression_bounds.py",
20+
"compiler/front_end/generated/cached_parser.py",
21+
"compiler/front_end/glue.py",
22+
"compiler/front_end/lr1.py",
23+
"compiler/front_end/make_parser.py",
24+
"compiler/front_end/module_ir.py",
25+
"compiler/front_end/parser.py",
26+
"compiler/front_end/prelude.emb",
27+
"compiler/front_end/reserved_words",
28+
"compiler/front_end/symbol_resolver.py",
29+
"compiler/front_end/synthetics.py",
30+
"compiler/front_end/tokenizer.py",
31+
"compiler/front_end/type_check.py",
32+
"compiler/front_end/write_inference.py",
33+
"compiler/util/__init__.py",
34+
"compiler/util/attribute_util.py",
35+
"compiler/util/error.py",
36+
"compiler/util/expression_parser.py",
37+
"compiler/util/ir_data.py",
38+
"compiler/util/ir_data_fields.py",
39+
"compiler/util/ir_data_utils.py",
40+
"compiler/util/ir_util.py",
41+
"compiler/util/name_conversion.py",
42+
"compiler/util/parser_types.py",
43+
"compiler/util/parser_util.py",
44+
"compiler/util/resources.py",
45+
"compiler/util/simple_memoizer.py",
46+
"compiler/util/traverse_ir.py",
47+
"embossc"
48+
],
49+
"emboss_runtime_cpp_sources": [
50+
"runtime/cpp/emboss_arithmetic.h",
51+
"runtime/cpp/emboss_arithmetic_all_known_generated.h",
52+
"runtime/cpp/emboss_arithmetic_maximum_operation_generated.h",
53+
"runtime/cpp/emboss_array_view.h",
54+
"runtime/cpp/emboss_bit_util.h",
55+
"runtime/cpp/emboss_constant_view.h",
56+
"runtime/cpp/emboss_cpp_types.h",
57+
"runtime/cpp/emboss_cpp_util.h",
58+
"runtime/cpp/emboss_defines.h",
59+
"runtime/cpp/emboss_enum_view.h",
60+
"runtime/cpp/emboss_maybe.h",
61+
"runtime/cpp/emboss_memory_util.h",
62+
"runtime/cpp/emboss_prelude.h",
63+
"runtime/cpp/emboss_text_util.h",
64+
"runtime/cpp/emboss_view_parameters.h"
65+
]
66+
}

0 commit comments

Comments
 (0)