mirror of
https://github.com/GayPizzaSpecifications/voxelotl-engine.git
synced 2025-08-03 05:10:57 +00:00
initial commit
This commit is contained in:
6
Sources/SDLSwift/CMakeLists.txt
Normal file
6
Sources/SDLSwift/CMakeLists.txt
Normal file
@ -0,0 +1,6 @@
|
||||
add_library(SDLSwift INTERFACE)
|
||||
set_property(TARGET SDLSwift PROPERTY Swift_MODULE_NAME "SDL3")
|
||||
|
||||
target_include_directories(SDLSwift INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
||||
target_link_libraries(SDLSwift INTERFACE ${SDL3})
|
3
Sources/SDLSwift/module.modulemap
Normal file
3
Sources/SDLSwift/module.modulemap
Normal file
@ -0,0 +1,3 @@
|
||||
module SDL3 [extern_c] {
|
||||
header "shim.h"
|
||||
}
|
3
Sources/SDLSwift/shim.h
Normal file
3
Sources/SDLSwift/shim.h
Normal file
@ -0,0 +1,3 @@
|
||||
#pragma once
|
||||
|
||||
#include <SDL3/SDL.h>
|
15
Sources/Voxelotl/CMakeLists.txt
Normal file
15
Sources/Voxelotl/CMakeLists.txt
Normal file
@ -0,0 +1,15 @@
|
||||
add_executable(Voxelotl MACOSX_BUNDLE main.swift)
|
||||
target_link_libraries(Voxelotl PRIVATE SDLSwift)
|
||||
set_target_properties(Voxelotl PROPERTIES
|
||||
XCODE_ATTRIBUTE_ENABLE_HARDENED_RUNTIME NO
|
||||
XCODE_EMBED_FRAMEWORKS "${SDL3}"
|
||||
XCODE_EMBED_FRAMEWORKS_REMOVE_HEADERS_ON_COPY YES
|
||||
XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY YES
|
||||
MACOSX_BUNDLE_BUNDLE_NAME "Voxelotl"
|
||||
MACOSX_BUNDLE_GUI_IDENTIFIER "gay.pizza.voxelotl"
|
||||
BUILD_RPATH "@loader_path/../Frameworks"
|
||||
XCODE_ATTRIBUTE_SKIP_INSTALL "NO"
|
||||
XCODE_ATTRIBUTE_INSTALL_PATH "$(LOCAL_APPS_DIR)"
|
||||
XCODE_GENERATE_SCHEME ON
|
||||
XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE "Metal"
|
||||
MACOSX_BUNDLE_COPYRIGHT "© 2024 Gay Pizza Specifications")
|
13
Sources/Voxelotl/main.swift
Normal file
13
Sources/Voxelotl/main.swift
Normal file
@ -0,0 +1,13 @@
|
||||
import Foundation
|
||||
import SDL3
|
||||
|
||||
guard SDL_Init(SDL_INIT_VIDEO) >= 0 else {
|
||||
print("SDL init failed.")
|
||||
exit(1)
|
||||
}
|
||||
|
||||
defer {
|
||||
SDL_Quit()
|
||||
}
|
||||
|
||||
print("SDL init success.")
|
Reference in New Issue
Block a user