rust/hgcli/pyoxidizer.bzl
changeset 47203 9438e9b7321a
parent 47201 95950dc832cf
child 47204 3380848c6e04
equal deleted inserted replaced
47202:0de5eefbe4b2 47203:9438e9b7321a
     7 
     7 
     8 set_build_path(ROOT + "/build/pyoxidizer")
     8 set_build_path(ROOT + "/build/pyoxidizer")
     9 
     9 
    10 def make_distribution():
    10 def make_distribution():
    11     return default_python_distribution(python_version = "3.8")
    11     return default_python_distribution(python_version = "3.8")
    12 
       
    13 def make_distribution_windows():
       
    14     return default_python_distribution(flavor = "standalone_dynamic")
       
    15 
    12 
    16 def resource_callback(policy, resource):
    13 def resource_callback(policy, resource):
    17     if not IS_WINDOWS:
    14     if not IS_WINDOWS:
    18         resource.add_location = "in-memory"
    15         resource.add_location = "in-memory"
    19         return
    16         return
    81     m = FileManifest()
    78     m = FileManifest()
    82     m.add_python_resource(".", exe)
    79     m.add_python_resource(".", exe)
    83 
    80 
    84     return m
    81     return m
    85 
    82 
    86 def make_embedded_resources(exe):
    83 register_target("distribution", make_distribution)
    87     return exe.to_embedded_resources()
    84 register_target("exe", make_exe, depends = ["distribution"])
    88 
    85 register_target("app", make_manifest, depends = ["distribution", "exe"], default = True)
    89 register_target("distribution_posix", make_distribution)
       
    90 register_target("distribution_windows", make_distribution_windows)
       
    91 
       
    92 register_target("exe_posix", make_exe, depends = ["distribution_posix"])
       
    93 register_target("exe_windows", make_exe, depends = ["distribution_windows"])
       
    94 
       
    95 register_target(
       
    96     "app_posix",
       
    97     make_manifest,
       
    98     depends = ["distribution_posix", "exe_posix"],
       
    99     default = "windows" not in BUILD_TARGET_TRIPLE,
       
   100 )
       
   101 register_target(
       
   102     "app_windows",
       
   103     make_manifest,
       
   104     depends = ["distribution_windows", "exe_windows"],
       
   105     default = "windows" in BUILD_TARGET_TRIPLE,
       
   106 )
       
   107 
    86 
   108 resolve_targets()
    87 resolve_targets()