|
152 | 152 | pl.add_compiler_flags("-fPIC") |
153 | 153 | pl.add_linker_flags("-ldl -lm") |
154 | 154 |
|
| 155 | + # mac os |
| 156 | + with pl.platform("Darwin"): |
| 157 | + with pl.compiler("clang"): |
| 158 | + pl.add_definitions("Py_PYTHON_H") |
| 159 | + pl.add_source_files("../../pilotlight/extensions/pl_platform_macos_ext.m") |
| 160 | + pl.add_compiler_flags("-fPIC") |
| 161 | + pl.add_linker_flags("-ldl -lm") |
| 162 | + |
155 | 163 | with pl.configuration("deploy"): |
156 | 164 |
|
157 | 165 | # win32 |
|
171 | 179 | pl.add_compiler_flags("-fPIC") |
172 | 180 | pl.add_linker_flags("-ldl -lm") |
173 | 181 |
|
| 182 | + # mac os |
| 183 | + with pl.platform("Darwin"): |
| 184 | + with pl.compiler("clang"): |
| 185 | + pl.add_definitions("Py_PYTHON_H") |
| 186 | + pl.add_source_files("../../pilotlight/extensions/pl_platform_macos_ext.m") |
| 187 | + pl.add_compiler_flags("-fPIC") |
| 188 | + pl.add_linker_flags("-ldl -lm") |
| 189 | + |
174 | 190 | #----------------------------------------------------------------------------- |
175 | 191 | # [SECTION] examples |
176 | 192 | #----------------------------------------------------------------------------- |
|
212 | 228 | pl.add_link_directories("../dependencies/cpython/build/debug/") |
213 | 229 | pl.add_compiler_flags("--debug -g") |
214 | 230 | pl.add_dynamic_link_libraries("python3.14d") |
| 231 | + |
| 232 | + # mac os |
| 233 | + with pl.platform("Darwin"): |
| 234 | + with pl.compiler("clang"): |
| 235 | + pl.add_definitions("PL_METAL_BACKEND") |
| 236 | + pl.add_link_directories("../dependencies/cpython/build/debug/") |
| 237 | + pl.add_compiler_flags("--debug -g") |
| 238 | + pl.add_dynamic_link_libraries("python3.14d") |
215 | 239 |
|
216 | 240 |
|
217 | 241 | #----------------------------------------------------------------------------- |
|
280 | 304 | pl.add_link_directories("../dependencies/cpython/build/debug/", '$VULKAN_SDK/lib') |
281 | 305 | # pl.set_post_target_build_step('@copy "%VULKAN_SDK%\\bin\\spirv-cross-c-shared.dll" "..\\pilotlight\\" >nul\n') |
282 | 306 |
|
| 307 | + # mac os |
| 308 | + with pl.platform("Darwin"): |
| 309 | + with pl.compiler("clang"): |
| 310 | + pl.add_definitions("PL_METAL_BACKEND") |
| 311 | + pl.set_output_binary("pilotlight") |
| 312 | + pl.set_output_binary_extension(".so") |
| 313 | + pl.add_compiler_flags("-fPIC", "--debug -g", "-std=c99", "-fmodules", "-ObjC", "-arch arm64") |
| 314 | + pl.add_linker_flags("-ldl -lm") |
| 315 | + pl.add_link_frameworks("Metal", "MetalKit", "Cocoa", "IOKit", "CoreVideo", "QuartzCore") |
| 316 | + pl.add_dynamic_link_libraries("shaderc_shared", "spirv-cross-c-shared") |
| 317 | + pl.add_static_link_libraries("glfwd", "pl_platform_ext") |
| 318 | + pl.add_link_directories("../dependencies/cpython/build/debug/", "/usr/local/lib") |
| 319 | + pl.add_compiler_flags("-Wno-deprecated-declarations") |
| 320 | + pl.add_dynamic_link_libraries("python3.14d") |
| 321 | + |
283 | 322 | with pl.configuration("deploy"): |
284 | 323 |
|
285 | 324 | pl.set_output_binary("pilotlight") |
|
326 | 365 | pl.add_static_link_libraries("glfw", "pl_platform_ext") |
327 | 366 | pl.add_link_directories('$VULKAN_SDK/lib') |
328 | 367 |
|
| 368 | + # mac os |
| 369 | + with pl.platform("Darwin"): |
| 370 | + with pl.compiler("clang"): |
| 371 | + pl.add_definitions("PL_METAL_BACKEND") |
| 372 | + pl.add_include_directories("$PL_PYTHON_INCLUDES") |
| 373 | + pl.add_link_directories('$VULKAN_SD/Lib') |
| 374 | + pl.set_output_binary("pilotlight") |
| 375 | + pl.set_output_binary_extension(".so") |
| 376 | + pl.add_compiler_flags("-fPIC", "-std=c99", "-fmodules", "-ObjC", "-arch arm64") |
| 377 | + pl.add_linker_flags("-ldl -lm", "-undefined dynamic_lookup") |
| 378 | + pl.add_link_frameworks("Metal", "MetalKit", "Cocoa", "IOKit", "CoreVideo", "QuartzCore") |
| 379 | + pl.add_dynamic_link_libraries("shaderc_shared", "spirv-cross-c-shared") |
| 380 | + pl.add_static_link_libraries("glfw", "pl_platform_ext") |
| 381 | + pl.add_link_directories("/usr/local/lib") |
| 382 | + pl.add_compiler_flags("-Wno-deprecated-declarations") |
| 383 | + # pl.add_dynamic_link_libraries("python3.14") |
| 384 | + |
329 | 385 | #----------------------------------------------------------------------------- |
330 | 386 | # [SECTION] generate scripts |
331 | 387 | #----------------------------------------------------------------------------- |
|
0 commit comments