mirror of
https://github.com/maplibre/maplibre-rs.git
synced 2025-12-08 19:05:57 +00:00
Use example instead of bin
This commit is contained in:
parent
83bea5663b
commit
2d12d79f3e
2
.github/workflows/rust.yml
vendored
2
.github/workflows/rust.yml
vendored
@ -24,7 +24,7 @@ jobs:
|
||||
- name: Install Dependencies
|
||||
run: sudo apt-get install -y libwayland-dev libxkbcommon-dev
|
||||
- name: Build
|
||||
run: cargo build --bin mapr
|
||||
run: cargo build --example desktop
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: mapr
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Run mapr" type="CargoCommandRunConfiguration" factoryName="Cargo Command">
|
||||
<option name="command" value="run --bin mapr" />
|
||||
<configuration default="false" name="Run desktop" type="CargoCommandRunConfiguration" factoryName="Cargo Command">
|
||||
<option name="command" value="run --example desktop" />
|
||||
<option name="workingDirectory" value="file://$PROJECT_DIR$" />
|
||||
<option name="channel" value="DEFAULT" />
|
||||
<option name="requiredFeatures" value="true" />
|
||||
12
Cargo.toml
12
Cargo.toml
@ -15,9 +15,6 @@ edition = "2021"
|
||||
resolver = "2"
|
||||
build = "build.rs"
|
||||
|
||||
[lib]
|
||||
crate-type = [ "rlib", "cdylib", "staticlib" ] # staticlib is used for apple
|
||||
|
||||
[package.metadata.wasm-pack.profile.release]
|
||||
wasm-opt = true
|
||||
|
||||
@ -95,6 +92,9 @@ test-env-log = "0.2"
|
||||
wgsl-validate = { path = "./libs/wgsl_validate" }
|
||||
mapr-utils = { path = "./libs/mapr_utils" }
|
||||
|
||||
[[bin]]
|
||||
name = "mapr"
|
||||
path = "src/main.rs"
|
||||
[lib]
|
||||
crate-type = [ "rlib", "cdylib", "staticlib" ] # staticlib is used for apple
|
||||
|
||||
[[example]]
|
||||
name = "desktop"
|
||||
crate-type = ["bin"]
|
||||
|
||||
@ -96,7 +96,7 @@ cargo build
|
||||
After that you can run it on your desktop:
|
||||
|
||||
```bash
|
||||
cargo run --bin mapr --
|
||||
cargo run --example desktop --
|
||||
```
|
||||
|
||||
More information about building for different platforms can be
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
The setup normal desktop is very simple. You just have to run the following:
|
||||
|
||||
```bash
|
||||
cargo run --bin mapr --
|
||||
cargo run --example desktop --
|
||||
```
|
||||
|
||||
## Android
|
||||
|
||||
@ -1,14 +1,6 @@
|
||||
use winit::event_loop::EventLoop;
|
||||
use winit::window::WindowBuilder;
|
||||
|
||||
mod fps_meter;
|
||||
mod platform;
|
||||
mod render;
|
||||
mod io;
|
||||
mod setup;
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
mod web;
|
||||
use mapr::setup;
|
||||
|
||||
fn main() {
|
||||
env_logger::init_from_env(env_logger::Env::default().default_filter_or("info"));
|
||||
11
src/lib.rs
11
src/lib.rs
@ -2,13 +2,4 @@ mod fps_meter;
|
||||
mod platform;
|
||||
mod render;
|
||||
mod io;
|
||||
mod setup;
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
mod web;
|
||||
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
mod apple;
|
||||
|
||||
#[cfg(target_os = "android")]
|
||||
mod android;
|
||||
pub mod setup;
|
||||
|
||||
@ -1,5 +0,0 @@
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
pub use instant::Instant;
|
||||
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
pub use std::time::Instant;
|
||||
@ -1,8 +1,8 @@
|
||||
use winit::event_loop::EventLoop;
|
||||
use winit::window::WindowBuilder;
|
||||
|
||||
#[no_mangle]
|
||||
fn mapr_apple_main() {
|
||||
use winit::event_loop::EventLoop;
|
||||
use winit::window::WindowBuilder;
|
||||
|
||||
env_logger::init_from_env(env_logger::Env::default().default_filter_or("info"));
|
||||
|
||||
let event_loop = EventLoop::new();
|
||||
15
src/platform/mod.rs
Normal file
15
src/platform/mod.rs
Normal file
@ -0,0 +1,15 @@
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
pub mod web;
|
||||
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
pub mod apple;
|
||||
|
||||
#[cfg(target_os = "android")]
|
||||
pub mod android;
|
||||
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
pub use instant::Instant;
|
||||
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
pub use std::time::Instant;
|
||||
Loading…
x
Reference in New Issue
Block a user