• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
2
3cc_library(
4    name = "compat-hdrs",
5    hdrs = glob(["includes/**/*.h"]),
6    defines = ["AEMU_WIN_COMPAT"],
7    includes = [
8        "includes",
9        "includes/dirent",
10    ],
11    target_compatible_with = [
12        "@platforms//os:windows",
13    ],
14    visibility = ["//visibility:public"],
15)
16
17cc_library(
18    name = "compat",
19    srcs = [
20        "src/dirent/dirent.cpp",
21    ] + glob([
22        "src/*.c",
23        "src/*.h",
24        "src/*.cpp",
25    ]),
26    defines = [
27        "WIN32_LEAN_AND_MEAN",
28    ],
29    includes = [
30        "src",
31    ],
32    linkopts = [
33        "-DEFAULTLIB:ws2_32.lib",
34        "-DEFAULTLIB:Pathcch.lib",
35        "-DEFAULTLIB:ole32.lib",
36        "-DEFAULTLIB:dxguid.lib",
37        "-DEFAULTLIB:Winmm.lib",
38    ],
39    linkstatic = True,
40    target_compatible_with = [
41        "@platforms//os:windows",
42    ],
43    visibility = ["//visibility:public"],
44    deps = [":compat-hdrs"],
45)
46
47cc_test(
48    name = "dirent_test",
49    srcs = [
50        "tests/dirent_test.cpp",
51    ],
52    target_compatible_with = [
53        "@platforms//os:windows",
54    ],
55    deps = [
56        ":compat",
57        "@com_google_googletest//:gtest_main",
58    ],
59)
60