add GUI wrapper skeleton

This commit is contained in:
numzero 2025-11-14 20:06:47 +03:00
parent f05390291c
commit 2575dd570c
9 changed files with 64 additions and 0 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
/target /target
/build

11
CMakeLists.txt Normal file
View File

@ -0,0 +1,11 @@
cmake_minimum_required(VERSION 3.18)
project(photon_light VERSION 1.0.0 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_program(CARGO cargo REQUIRED)
set(CARGO_TARGET_DIR "${CMAKE_BINARY_DIR}/cargo")
add_subdirectory(ui)

7
Cargo.lock generated
View File

@ -1165,6 +1165,13 @@ dependencies = [
"winit", "winit",
] ]
[[package]]
name = "photon-light-impl"
version = "0.1.0"
dependencies = [
"photon-light",
]
[[package]] [[package]]
name = "pin-project" name = "pin-project"
version = "1.1.10" version = "1.1.10"

View File

@ -1,3 +1,6 @@
[workspace]
members = ["ui"]
[package] [package]
name = "photon-light" name = "photon-light"
version = "0.1.0" version = "0.1.0"

7
ui/CMakeLists.txt Normal file
View File

@ -0,0 +1,7 @@
include(impl.cmake)
add_executable(photon_light
src/main.cxx
)
target_link_libraries(photon_light PRIVATE photon_light_impl)

10
ui/Cargo.toml Normal file
View File

@ -0,0 +1,10 @@
[package]
name = "photon-light-impl"
version = "0.1.0"
edition = "2024"
[lib]
crate-type = ["staticlib"]
[dependencies]
photon-light = {path = "../"}

22
ui/impl.cmake Normal file
View File

@ -0,0 +1,22 @@
set(impl_basename "${CARGO_TARGET_DIR}/release/libphoton_light_impl")
add_custom_command(
OUTPUT ${impl_basename}.a
COMMAND env CARGO_TARGET_DIR=${CARGO_TARGET_DIR} ${CARGO} build --release --package photon-light-impl
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPFILE ${impl_basename}.d
USES_TERMINAL
JOB_SERVER_AWARE
DEPENDS_EXPLICIT_ONLY
)
# HACK ensure CMake *actually adds* the command above
add_custom_target(build_impl
DEPENDS ${impl_basename}.a
)
add_library(photon_light_impl STATIC IMPORTED)
set_target_properties(photon_light_impl PROPERTIES
IMPORTED_LOCATION ${impl_basename}.a
)

0
ui/src/lib.rs Normal file
View File

3
ui/src/main.cxx Normal file
View File

@ -0,0 +1,3 @@
int main() {
return 0;
}