Mercurial
comparison third_party/raylib/raylib.bzl @ 61:9df5587cf23b
[Color game] It can compile on windows now.
| author | June Park <me@mrjunejune.com> |
|---|---|
| date | Sat, 20 Dec 2025 21:07:34 -0500 |
| parents | ccb42d5bf8fd |
| children | 75de5903355c |
comparison
equal
deleted
inserted
replaced
| 60:d64a8c189a77 | 61:9df5587cf23b |
|---|---|
| 2 name, | 2 name, |
| 3 srcs, | 3 srcs, |
| 4 deps = [], | 4 deps = [], |
| 5 deps_macos = [], | 5 deps_macos = [], |
| 6 deps_linux = [], | 6 deps_linux = [], |
| 7 deps_windows = [], | |
| 7 linkopts_macos = [ | 8 linkopts_macos = [ |
| 8 "-framework CoreVideo", | 9 "-framework CoreVideo", |
| 9 "-framework IOKit", | 10 "-framework IOKit", |
| 10 "-framework Cocoa", | 11 "-framework Cocoa", |
| 11 "-framework GLUT", | 12 "-framework GLUT", |
| 17 "-lpthread", | 18 "-lpthread", |
| 18 "-ldl", | 19 "-ldl", |
| 19 "-lrt", | 20 "-lrt", |
| 20 "-lX11", | 21 "-lX11", |
| 21 ], | 22 ], |
| 23 linkopts_windows = [ | |
| 24 "/DEFAULTLIB:winmm.lib", | |
| 25 "/DEFAULTLIB:gdi32.lib", | |
| 26 "/DEFAULTLIB:opengl32.lib", | |
| 27 "/DEFAULTLIB:user32.lib", | |
| 28 "/DEFAULTLIB:shell32.lib", | |
| 29 ], | |
| 22 static = False | 30 static = False |
| 23 ): | 31 ): |
| 24 """ | 32 """ |
| 25 Raylib specific cross platform rules. | 33 Raylib specific cross platform rules. |
| 26 | |
| 27 Args: | 34 Args: |
| 28 name: The logical name of the binary (alias). | 35 name: The logical name of the binary (alias). |
| 29 srcs: List of source files (common). | 36 srcs: List of source files (common). |
| 30 deps: Mutual dependency. | 37 deps: Mutual dependency. |
| 31 deps_macos: Extra deps for macOS. | 38 deps_macos: Extra deps for macOS. |
| 32 deps_linux: Extra deps for Linux. | 39 deps_linux: Extra deps for Linux. |
| 40 deps_windows: Extra deps for Windows. | |
| 33 linkopts_macos: Extra linkopts for macOS. | 41 linkopts_macos: Extra linkopts for macOS. |
| 34 linkopts_linux: Extra linkopts for Linux. | 42 linkopts_linux: Extra linkopts for Linux. |
| 35 static: Make build exectuable static | 43 linkopts_windows: Extra linkopts for Windows. |
| 44 static: Make build executable static | |
| 36 """ | 45 """ |
| 37 | |
| 38 macos_bin = name + "_macos" | 46 macos_bin = name + "_macos" |
| 39 linux_bin = name + "_linux" | 47 linux_bin = name + "_linux" |
| 40 | 48 windows_bin = name + "_windows" |
| 49 | |
| 41 native.cc_binary( | 50 native.cc_binary( |
| 42 name = macos_bin, | 51 name = macos_bin, |
| 43 srcs = srcs, | 52 srcs = srcs, |
| 44 deps = deps + deps_macos, | 53 deps = deps + deps_macos, |
| 45 linkopts = linkopts_macos, | 54 linkopts = linkopts_macos, |
| 46 linkstatic = static, | 55 linkstatic = static, |
| 47 ) | 56 ) |
| 48 | 57 |
| 49 native.cc_binary( | 58 native.cc_binary( |
| 50 name = linux_bin, | 59 name = linux_bin, |
| 51 srcs = srcs, | 60 srcs = srcs, |
| 52 deps = deps + deps_linux, | 61 deps = deps + deps_linux, |
| 53 linkopts = linkopts_linux, | 62 linkopts = linkopts_linux, |
| 54 linkstatic = static, | 63 linkstatic = static, |
| 55 ) | 64 ) |
| 56 | 65 |
| 66 native.cc_binary( | |
| 67 name = windows_bin, | |
| 68 srcs = srcs, | |
| 69 deps = deps + deps_windows, | |
| 70 linkopts = linkopts_windows, | |
| 71 linkstatic = static, | |
| 72 ) | |
| 73 | |
| 57 native.alias( | 74 native.alias( |
| 58 name = name, | 75 name = name, |
| 59 actual = select({ | 76 actual = select({ |
| 60 "//config:macos": ":" + macos_bin, | 77 "//config:macos": ":" + macos_bin, |
| 61 "//config:linux": ":" + linux_bin, | 78 "//config:linux": ":" + linux_bin, |
| 79 "//config:windows": ":" + windows_bin, | |
| 62 "//conditions:default": ":" + linux_bin, # fallback | 80 "//conditions:default": ":" + linux_bin, # fallback |
| 63 }), | 81 }), |
| 64 ) | 82 ) |