mirror of
https://github.com/maplibre/maplibre-rs.git
synced 2025-12-08 19:05:57 +00:00
Minor refactor of project files
This commit is contained in:
parent
ebc19aad84
commit
63a8013b7c
18
.idea/runConfigurations/Build_mapr__WASM_.xml
generated
18
.idea/runConfigurations/Build_mapr__WASM_.xml
generated
@ -1,18 +0,0 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Build mapr (WASM)" type="CargoCommandRunConfiguration" factoryName="Cargo Command">
|
||||
<option name="command" value="build --target wasm32-unknown-unknown --bin mapr" />
|
||||
<option name="workingDirectory" value="file://$PROJECT_DIR$" />
|
||||
<option name="channel" value="DEFAULT" />
|
||||
<option name="requiredFeatures" value="true" />
|
||||
<option name="allFeatures" value="false" />
|
||||
<option name="emulateTerminal" value="false" />
|
||||
<option name="withSudo" value="false" />
|
||||
<option name="backtrace" value="SHORT" />
|
||||
<envs />
|
||||
<option name="isRedirectInput" value="false" />
|
||||
<option name="redirectInputPath" value="" />
|
||||
<method v="2">
|
||||
<option name="CARGO.BUILD_TASK_PROVIDER" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
||||
2
.idea/runConfigurations/Run_downloader.xml
generated
2
.idea/runConfigurations/Run_downloader.xml
generated
@ -1,6 +1,6 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Run downloader" type="CargoCommandRunConfiguration" factoryName="Cargo Command">
|
||||
<option name="command" value="run --bin download_tiles" />
|
||||
<option name="command" value="run -p mapr-utils --bin download_tiles" />
|
||||
<option name="workingDirectory" value="file://$PROJECT_DIR$/libs/mapr_utils" />
|
||||
<option name="channel" value="DEFAULT" />
|
||||
<option name="requiredFeatures" value="true" />
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
use std::fs::File;
|
||||
use std::io;
|
||||
use std::io::{BufRead, BufReader, Read};
|
||||
use std::path::{Path};
|
||||
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
[toolchain]
|
||||
channel = "1.57"
|
||||
targets = [ "wasm32-unknown-unknown", "x86_64-unknown-linux-gnu" ]
|
||||
components = [ "rust-src" ] # rust-src is required for WASM builds which recompile the stdlib
|
||||
15
src/lib.rs
15
src/lib.rs
@ -1,6 +1,3 @@
|
||||
use winit::event_loop::EventLoop;
|
||||
use winit::window::WindowBuilder;
|
||||
|
||||
mod fps_meter;
|
||||
mod platform;
|
||||
mod render;
|
||||
@ -9,15 +6,3 @@ mod setup;
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
mod web;
|
||||
|
||||
fn main() {
|
||||
env_logger::init_from_env(env_logger::Env::default().default_filter_or("info"));
|
||||
|
||||
let event_loop = EventLoop::new();
|
||||
let window = WindowBuilder::new()
|
||||
.with_title("A fantastic window!")
|
||||
.build(&event_loop)
|
||||
.unwrap();
|
||||
|
||||
pollster::block_on(setup::setup(window, event_loop));
|
||||
}
|
||||
|
||||
23
src/main.rs
Normal file
23
src/main.rs
Normal file
@ -0,0 +1,23 @@
|
||||
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;
|
||||
|
||||
fn main() {
|
||||
env_logger::init_from_env(env_logger::Env::default().default_filter_or("info"));
|
||||
|
||||
let event_loop = EventLoop::new();
|
||||
let window = WindowBuilder::new()
|
||||
.with_title("A fantastic window!")
|
||||
.build(&event_loop)
|
||||
.unwrap();
|
||||
|
||||
pollster::block_on(setup::setup(window, event_loop));
|
||||
}
|
||||
@ -17,14 +17,18 @@ while true; do
|
||||
esac
|
||||
done
|
||||
|
||||
export RUSTUP_TOOLCHAIN=nightly-2021-12-07-x86_64-unknown-linux-gnu
|
||||
|
||||
rustup component add rust-src --toolchain nightly-2021-12-07-x86_64-unknown-linux-gnu
|
||||
|
||||
function plain_build() {
|
||||
cargo +nightly build --features "$webgl_flag" --target wasm32-unknown-unknown -Z build-std=std,panic_abort
|
||||
cargo build --features "$webgl_flag" --target wasm32-unknown-unknown -Z build-std=std,panic_abort
|
||||
# TODO: Untested: --reference-types
|
||||
wasm-bindgen --target web --out-dir dist/mapr-pain-bindgen target/wasm32-unknown-unknown/debug/mapr.wasm
|
||||
}
|
||||
|
||||
function wasm_pack_build() {
|
||||
rustup run nightly ~/Downloads/wasm-pack-v0.10.1-x86_64-unknown-linux-musl/wasm-pack build . \
|
||||
~/Downloads/wasm-pack-v0.10.1-x86_64-unknown-linux-musl/wasm-pack build . \
|
||||
--release --target web --out-dir dist/mapr -- \
|
||||
--features "$webgl_flag" -Z build-std=std,panic_abort
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user