0.2.0-dev Download ZIP
36 lines ·1.1 KB Raw
| 1 | #!/usr/bin/env python |
| 2 | from misc.utility.scons_hints import * |
| 3 | |
| 4 | from SCons.Script import Glob |
| 5 | |
| 6 | from platform_methods import setup_swift_builder |
| 7 | |
| 8 | Import("env") |
| 9 | |
| 10 | env_apple_embedded = env.Clone() |
| 11 | |
| 12 | # Enable module support |
| 13 | env_apple_embedded.Append(CCFLAGS=["-fmodules", "-fcxx-modules"]) |
| 14 | |
| 15 | # Configure Swift builder |
| 16 | apple_platform = env["APPLE_PLATFORM"] |
| 17 | sdk_path = env["APPLE_SDK_PATH"] |
| 18 | current_path = Dir(".").abspath |
| 19 | bridging_header_filename = "bridging_header_apple_embedded.h" |
| 20 | swift_files = Glob("*.swift") |
| 21 | swift_file_names = list(map(lambda f: f.name, swift_files)) |
| 22 | setup_swift_builder( |
| 23 | env_apple_embedded, apple_platform, sdk_path, current_path, bridging_header_filename, swift_file_names |
| 24 | ) |
| 25 | |
| 26 | # Use bundled Vulkan headers |
| 27 | vulkan_dir = "#thirdparty/vulkan" |
| 28 | env_apple_embedded.Prepend(CPPPATH=[vulkan_dir, vulkan_dir + "/include"]) |
| 29 | |
| 30 | # Use bundled metal-cpp headers |
| 31 | env_apple_embedded.Prepend(CPPPATH=["#thirdparty/metal-cpp"]) |
| 32 | |
| 33 | # Driver source files. |
| 34 | # Note: ".swift" files are compiled separately, as a whole module, using `swiftc`. |
| 35 | # Only compiling ".mm" files here. |
| 36 | env_apple_embedded.add_source_files(env_apple_embedded.drivers_sources, "*.mm") |