Skip to content

Commit 1267966

Browse files
committed
chore: use unreal naming convention for platform names
1 parent 7f41fbe commit 1267966

File tree

2 files changed

+33
-2
lines changed

2 files changed

+33
-2
lines changed

Tools/EcsactUnrealCodegen/BUILD.bazel

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
load("@aspect_bazel_lib//lib:transitions.bzl", "platform_transition_filegroup")
2+
load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
23
load("@rules_cc//cc:defs.bzl", "cc_binary")
34

45
package(default_visibility = ["//visibility:public"])
@@ -32,16 +33,45 @@ PLATFORMS = [
3233
"@zig_sdk//platform:darwin_arm64",
3334
]
3435

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+
3552
[
3653
platform_transition_filegroup(
37-
name = "EcsactUnrealCodegen-" + platform.split(":")[1],
54+
name = "for_{}-EcsactUnrealCodegen".format(platform.split(":")[1]),
3855
srcs = [":EcsactUnrealCodegen"],
3956
target_platform = platform,
4057
)
4158
for platform in PLATFORMS
4259
]
4360

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+
4474
filegroup(
4575
name = "AllPlatforms",
46-
srcs = ["EcsactUnrealCodegen-" + platform.split(":")[1] for platform in PLATFORMS],
76+
srcs = [":copy_EcsactUnrealCodegen-{}".format(platform.split(":")[1]) for platform in PLATFORMS],
4777
)

Tools/EcsactUnrealCodegen/MODULE.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ bazel_dep(name = "rules_cc", version = "0.0.17")
44
bazel_dep(name = "boost.process", version = "1.83.0.bcr.1")
55
bazel_dep(name = "aspect_bazel_lib", version = "2.13.0")
66
bazel_dep(name = "platforms", version = "0.0.11")
7+
bazel_dep(name = "bazel_skylib", version = "1.7.1")
78
bazel_dep(name = "boost.program_options", version = "1.83.0.bcr.2")
89
bazel_dep(name = "hermetic_cc_toolchain", version = "3.1.1")
910

0 commit comments

Comments
 (0)