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:
Logan McNaughton
2023-10-04 17:52:58 -06:00
committed by GitHub
parent 2e4a23c315
commit f7a586a1e0
3 changed files with 65 additions and 7 deletions
+51
View File
@@ -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
View File
@@ -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
+7 -4
View File
@@ -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");
}