|
108 | 108 |
|
109 | 109 | pl.add_link_frameworks("Cocoa", "IOKit", "CoreFoundation") |
110 | 110 |
|
| 111 | + with pl.configuration("deploy"): |
| 112 | + |
| 113 | + pl.set_output_binary("glfw") |
| 114 | + |
| 115 | + # win32 |
| 116 | + with pl.platform("Windows"): |
| 117 | + with pl.compiler("msvc"): |
| 118 | + pl.add_include_directories("%VULKAN_SDK%\\Include") |
| 119 | + pl.add_definitions("UNICODE", "_UNICODE", "_CRT_SECURE_NO_WARNINGS", "_GLFW_VULKAN_STATIC", "_GLFW_WIN32") |
| 120 | + pl.add_compiler_flags("-nologo", "-std:c11", "-W3", "-wd5105", "-O2", "-MD", "-Zi", "-permissive") |
| 121 | + pl.add_linker_flags("-incremental:no", "-nologo") |
| 122 | + |
| 123 | + # linux |
| 124 | + with pl.platform("Linux"): |
| 125 | + with pl.compiler("gcc"): |
| 126 | + pl.add_definitions("_GLFW_VULKAN_STATIC", "_GLFW_X11") |
| 127 | + pl.add_include_directories('$VULKAN_SDK/include', '/usr/include/vulkan', '/usr/include/vulkan') |
| 128 | + pl.add_dynamic_link_libraries("xcb", "X11", "X11-xcb", "xkbcommon", "pthread", "xcb-cursor", "vulkan") |
| 129 | + pl.add_link_directories('$VULKAN_SDK/lib') |
| 130 | + pl.add_compiler_flags("-fPIC", "-std=gnu99") |
| 131 | + pl.add_linker_flags("-ldl -lm") |
| 132 | + pl.add_source_files("../dependencies/glfw/src/posix_poll.c") |
| 133 | + |
| 134 | + # apple |
| 135 | + with pl.platform("Darwin"): |
| 136 | + with pl.compiler("clang"): |
| 137 | + pl.add_definitions("_GLFW_VULKAN_STATIC", "_GLFW_COCOA") |
| 138 | + pl.add_include_directories('$VULKAN_SDK/include', '/usr/include/vulkan', '/usr/include/vulkan') |
| 139 | + pl.add_dynamic_link_libraries("spirv-cross-c-shared", "shaderc_shared", "vulkan") |
| 140 | + pl.add_link_directories('$VULKAN_SDK/lib', "/usr/local/lib") |
| 141 | + pl.add_compiler_flags("-std=c99", "-fmodules", "-ObjC", "-fPIC", "-Wno-deprecated-declarations") |
| 142 | + |
| 143 | + pl.add_link_frameworks("Cocoa", "IOKit", "CoreFoundation") |
| 144 | + |
111 | 145 | #----------------------------------------------------------------------------- |
112 | 146 | # [SECTION] examples |
113 | 147 | #----------------------------------------------------------------------------- |
|
150 | 184 | pl.add_static_link_libraries("ucrt", "user32", "Ole32") |
151 | 185 | pl.add_compiler_flags("-std:c11", "-nologo") |
152 | 186 |
|
| 187 | + with pl.configuration("deploy"): |
| 188 | + |
| 189 | + # win32 |
| 190 | + with pl.platform("Windows"): |
| 191 | + with pl.compiler("msvc"): |
| 192 | + pl.add_definitions("Py_PYTHON_H") |
| 193 | + pl.add_source_files("../../pilotlight/extensions/pl_platform_win32_ext.c") |
| 194 | + pl.add_static_link_libraries("ucrt", "user32", "Ole32") |
| 195 | + pl.add_compiler_flags("-std:c11", "-nologo") |
| 196 | + |
153 | 197 | with pl.target("pilotlight_python", pl.TargetType.EXECUTABLE, False): |
154 | 198 |
|
155 | 199 | pl.add_include_directories( |
|
248 | 292 | "-permissive-", "-Od", "-MD", "-Zi") |
249 | 293 | pl.set_post_target_build_step('@copy "%VULKAN_SDK%\\bin\\spirv-cross-c-shared.dll" "..\\pilotlight\\" >nul\n') |
250 | 294 |
|
| 295 | + with pl.configuration("deploy"): |
| 296 | + |
| 297 | + pl.set_output_binary("pilotlight") |
| 298 | + pl.set_output_directory("../pilotlight") |
| 299 | + |
| 300 | + # win32 |
| 301 | + with pl.platform("Windows"): |
| 302 | + with pl.compiler("msvc"): |
| 303 | + |
| 304 | + pl.add_include_directories( |
| 305 | + "C:/hostedtoolcache/windows/Python/3.14.3/x64/Include" |
| 306 | + ) |
| 307 | + |
| 308 | + pl.add_definitions("PL_VULKAN_BACKEND") |
| 309 | + pl.add_include_directories("%VULKAN_SDK%\\Include") |
| 310 | + pl.set_output_binary_extension(".pyd") |
| 311 | + pl.add_static_link_libraries("shaderc_combined", "spirv-cross-c-shared", "vulkan-1", "glfw") |
| 312 | + pl.add_static_link_libraries("user32", "Shell32", "Ole32", "gdi32", "ucrt", "pl_platform_ext") |
| 313 | + pl.add_link_directories("C:/hostedtoolcache/windows/Python/3.14.3/x64/libs", '%VULKAN_SDK%\\Lib') |
| 314 | + pl.add_linker_flags("-noimplib", "-noexp", "-incremental:no", "-nodefaultlib:LIBCMT") |
| 315 | + pl.add_compiler_flags("-Zc:preprocessor", "-nologo", "-std:c11", "-W4", "-WX", "-wd4201", |
| 316 | + "-wd4100", "-wd4996", "-wd4505", "-wd4189", "-wd5105", "-wd4115", |
| 317 | + "-permissive-", "-Od", "-MD", "-Zi") |
| 318 | + pl.set_post_target_build_step('@copy "%VULKAN_SDK%\\bin\\spirv-cross-c-shared.dll" "..\\pilotlight\\" >nul\n') |
| 319 | + |
251 | 320 |
|
252 | 321 | #----------------------------------------------------------------------------- |
253 | 322 | # [SECTION] generate scripts |
|
0 commit comments