Skip to content

Commit

Permalink
Links resources.rc (#1153)
Browse files Browse the repository at this point in the history
  • Loading branch information
ultimaweapon authored Dec 1, 2024
1 parent 479d19b commit e66e2d0
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 7 deletions.
21 changes: 20 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ add_executable(obliteration WIN32 MACOSX_BUNDLE
system.cpp)

if(WIN32)
target_sources(obliteration PRIVATE resources.rc vulkan.cpp)
target_sources(obliteration PRIVATE vulkan.cpp)
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
target_sources(obliteration PRIVATE vulkan.cpp)
endif()
Expand Down
3 changes: 3 additions & 0 deletions gui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,6 @@ objc = "0.2.7"

[build-dependencies]
slint-build = "1.8.0"

[target.'cfg(windows)'.build-dependencies]
winres = "0.1.12"
14 changes: 9 additions & 5 deletions gui/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@ use std::collections::HashMap;
use std::path::PathBuf;

fn main() {
// Build path for @root.
let mut root = PathBuf::from(std::env::var_os("CARGO_MANIFEST_DIR").unwrap());

root.push("ui");
let root = PathBuf::from(std::env::var_os("CARGO_MANIFEST_DIR").unwrap());

// Compile Slint.
let config = CompilerConfiguration::new()
.with_style(String::from("fluent-dark"))
.with_library_paths(HashMap::from([("root".into(), root)]));
.with_library_paths(HashMap::from([("root".into(), root.join("ui"))]));

slint_build::compile_with_config(PathBuf::from_iter(["ui", "main.slint"]), config).unwrap();

// Compile resources.rc.
#[cfg(windows)]
winres::WindowsResource::new()
.set_resource_file(root.join("resources.rc").to_str().unwrap())
.compile()
.unwrap();
}
File renamed without changes.
Binary file modified gui/resources.rc
Binary file not shown.

0 comments on commit e66e2d0

Please sign in to comment.