mirror of
https://github.com/gopher64/gopher64.git
synced 2026-07-11 01:25:20 +02:00
add build workflow (#2)
* add build workflow * more * more * more * more * more * more * more * more * more * more * more * fix * more * more * more * more * more * remove pkg-config * remove * more * fix * last
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
name: Rust
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["main"]
|
||||
pull_request:
|
||||
branches: ["main"]
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
build-linux:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Update rust
|
||||
run: |
|
||||
rustup default nightly
|
||||
rustup update
|
||||
- name: Build
|
||||
run: |
|
||||
./build_release.sh
|
||||
- name: Upload file
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: gopher64-linux
|
||||
path: target/release/gopher64
|
||||
|
||||
build-windows:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Update rust
|
||||
shell: bash
|
||||
run: |
|
||||
rustup default nightly
|
||||
rustup update
|
||||
- name: Build
|
||||
shell: bash
|
||||
run: |
|
||||
./build_release.sh
|
||||
- name: Upload file
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: gopher64-windows
|
||||
path: target/release/gopher64.exe
|
||||
+7
-3
@@ -1,16 +1,20 @@
|
||||
[package]
|
||||
name = "rust64"
|
||||
name = "gopher64"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
sdl2 = "0.35"
|
||||
sdl2-sys = { git = "https://github.com/Rust-SDL2/rust-sdl2.git" }
|
||||
|
||||
[dependencies.sdl2]
|
||||
git = "https://github.com/Rust-SDL2/rust-sdl2.git"
|
||||
default-features = false
|
||||
features = ["static-link","bundled"]
|
||||
|
||||
[build-dependencies]
|
||||
cc = { version = "1.0", features = ["parallel"] }
|
||||
pkg-config = "0.3"
|
||||
|
||||
[profile.release]
|
||||
lto = true
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
fn main() {
|
||||
let sdl = pkg_config::Config::new().probe("sdl2").unwrap();
|
||||
let mut build = cc::Build::new();
|
||||
build
|
||||
.cpp(true)
|
||||
.flag("-Wno-missing-field-initializers")
|
||||
.flag("-Wno-unused-parameter")
|
||||
.file("parallel-rdp/parallel-rdp-standalone/parallel-rdp/command_ring.cpp")
|
||||
.file("parallel-rdp/parallel-rdp-standalone/parallel-rdp/rdp_device.cpp")
|
||||
.file("parallel-rdp/parallel-rdp-standalone/parallel-rdp/rdp_dump_write.cpp")
|
||||
@@ -48,11 +45,17 @@ fn main() {
|
||||
.include("parallel-rdp/parallel-rdp-standalone/vulkan")
|
||||
.include("parallel-rdp/parallel-rdp-standalone/vulkan-headers/include")
|
||||
.include("parallel-rdp/parallel-rdp-standalone/util")
|
||||
.includes(sdl.include_paths);
|
||||
.includes(std::env::var("DEP_SDL2_INCLUDE"));
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
build.flag("-DVK_USE_PLATFORM_WIN32_KHR");
|
||||
}
|
||||
#[cfg(target_os = "linux")]
|
||||
{
|
||||
build
|
||||
.flag("-Wno-missing-field-initializers")
|
||||
.flag("-Wno-unused-parameter");
|
||||
}
|
||||
build.compile("parallel-rdp");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user