Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / third_party / pigweed / repo / pw_env_setup / py / pyoxidizer.bzl.tmpl
1 # Copyright 2020 The Pigweed Authors
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License"); you may not
4 # use this file except in compliance with the License. You may obtain a copy of
5 # 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, WITHOUT
11 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12 # License for the specific language governing permissions and limitations under
13 # the License.
14
15 def make_dist():
16     return default_python_distribution()
17
18 def make_exe(dist):
19     python_config = PythonInterpreterConfig(
20          run_module='pw_env_setup.env_setup',
21     )
22
23     exe = dist.to_python_executable(
24         name="pw_env_setup",
25         config=python_config,
26         extension_module_filter='all',
27         include_sources=True,
28         include_resources=True,
29         include_test=False,
30     )
31     exe.add_python_resources(dist.pip_install(["${PW_ROOT}/pw_env_setup/py"]))
32
33     return exe
34
35 def make_embedded_data(exe):
36     return exe.to_embedded_data()
37
38 def make_install(exe):
39     files = FileManifest()
40     files.add_python_resource(".", exe)
41     return files
42
43 register_target("dist", make_dist)
44 register_target("exe", make_exe, depends=["dist"], default=True)
45 register_target("embedded", make_embedded_data, depends=["exe"],
46                 default_build_script=True)
47 register_target("install", make_install, depends=["exe"])
48
49 resolve_targets()
50
51 # END OF COMMON USER-ADJUSTED SETTINGS.
52 #
53 # Everything below this is typically managed by PyOxidizer and doesn't need
54 # to be updated by people.
55
56 PYOXIDIZER_VERSION = "0.6.0"
57 PYOXIDIZER_COMMIT = "UNKNOWN"