|
1 | 1 | load("@aspect_bazel_lib//lib:transitions.bzl", "platform_transition_filegroup")
|
| 2 | +load("@bazel_skylib//rules:copy_file.bzl", "copy_file") |
2 | 3 | load("@rules_cc//cc:defs.bzl", "cc_binary")
|
3 | 4 |
|
4 | 5 | package(default_visibility = ["//visibility:public"])
|
@@ -32,16 +33,45 @@ PLATFORMS = [
|
32 | 33 | "@zig_sdk//platform:darwin_arm64",
|
33 | 34 | ]
|
34 | 35 |
|
| 36 | +PLATFORMS_EXT = { |
| 37 | + "windows_amd64": ".exe", |
| 38 | + "linux_amd64": "", |
| 39 | + "linux_arm64": "", |
| 40 | + "darwin_amd64": "", |
| 41 | + "darwin_arm64": "", |
| 42 | +} |
| 43 | + |
| 44 | +PLATFORM_UNREAL_MAP = { |
| 45 | + "windows_amd64": "Win64", |
| 46 | + "linux_amd64": "Linux", |
| 47 | + "linux_arm64": "LinuxArm", |
| 48 | + "darwin_amd64": "Mac", |
| 49 | + "darwin_arm64": "MacArm", |
| 50 | +} |
| 51 | + |
35 | 52 | [
|
36 | 53 | platform_transition_filegroup(
|
37 |
| - name = "EcsactUnrealCodegen-" + platform.split(":")[1], |
| 54 | + name = "for_{}-EcsactUnrealCodegen".format(platform.split(":")[1]), |
38 | 55 | srcs = [":EcsactUnrealCodegen"],
|
39 | 56 | target_platform = platform,
|
40 | 57 | )
|
41 | 58 | for platform in PLATFORMS
|
42 | 59 | ]
|
43 | 60 |
|
| 61 | +[ |
| 62 | + copy_file( |
| 63 | + name = "copy_EcsactUnrealCodegen-{}".format(platform.split(":")[1]), |
| 64 | + src = ":for_{}-EcsactUnrealCodegen".format(platform.split(":")[1]), |
| 65 | + out = "EcsactUnrealCodegen-{}{}".format( |
| 66 | + PLATFORM_UNREAL_MAP[platform.split(":")[1]], |
| 67 | + PLATFORMS_EXT[platform.split(":")[1]], |
| 68 | + ), |
| 69 | + is_executable = True, |
| 70 | + ) |
| 71 | + for platform in PLATFORMS |
| 72 | +] |
| 73 | + |
44 | 74 | filegroup(
|
45 | 75 | name = "AllPlatforms",
|
46 |
| - srcs = ["EcsactUnrealCodegen-" + platform.split(":")[1] for platform in PLATFORMS], |
| 76 | + srcs = [":copy_EcsactUnrealCodegen-{}".format(platform.split(":")[1]) for platform in PLATFORMS], |
47 | 77 | )
|
0 commit comments