Skip to content
This repository has been archived by the owner on Jun 7, 2022. It is now read-only.

Commit

Permalink
linux ci
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonoughe committed May 6, 2018
1 parent bdee0a8 commit 85dd2b7
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
language: rust
rust:
- stable
cache: cargo
os: linux
dist: trusty
sudo: required
addons:
apt:
sources:
- sourceline: ppa:kirillshkrogalev/ffmpeg-next
- sourceline: ppa:obsproject/obs-studio
packages:
- obs-studio
script:
- cargo build --verbose --all
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ obs-gpmdp is the plugin itself. Inside obs-gpmdp the obs module tries to be a ge

obs-gpmdp is built using [Cargo] which should be installed if you follow the [Rust installation instructions](https://www.rust-lang.org/en-US/install.html).

You will need to install [Clang] for [rust-bindgen] to work. See [rust-bindgen requirements](https://rust-lang-nursery.github.io/rust-bindgen/requirements.html).

On Windows the build script will try to find an installation of OBS to link against. On other systems you may need to set environment variables so the linker can find OBS.

[OBS Studio]: https://obsproject.com/
Expand All @@ -60,3 +62,4 @@ On Windows the build script will try to find an installation of OBS to link agai
[Rust]: https://www.rust-lang.org/en-US/
[rust-bindgen]: https://rust-lang-nursery.github.io/rust-bindgen/
[Cargo]: https://doc.rust-lang.org/cargo/guide/
[Clang]: https://clang.llvm.org/
16 changes: 16 additions & 0 deletions libobs-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,27 @@ mod build_win;
#[cfg(windows)]
use build_win::find_windows_obs_lib;

use bindgen::callbacks::{MacroParsingBehavior, ParseCallbacks};
use std::env;
use std::path::PathBuf;

#[cfg(not(windows))]
fn find_windows_obs_lib() {}

#[derive(Debug)]
struct MacroCallback();

impl ParseCallbacks for MacroCallback {
fn will_parse_macro(&self, name: &str) -> MacroParsingBehavior {
match name {
"FP_ZERO" | "FP_SUBNORMAL" | "FP_NORMAL" | "FP_INFINITE" | "FP_NAN" => {
MacroParsingBehavior::Ignore
}
_ => MacroParsingBehavior::Default,
}
}
}

fn main() {
// Tell cargo to tell rustc to link the system obs
// shared library.
Expand All @@ -29,6 +44,7 @@ fn main() {
// to bindgen, and lets you build up options for
// the resulting bindings.
let bindings = bindgen::Builder::default()
.parse_callbacks(Box::new(MacroCallback()))
// The input header we would like to generate
// bindings for.
.header("wrapper.h")
Expand Down
2 changes: 2 additions & 0 deletions libobs-sys/wrapper.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#include "obs/libobs/obs-module.h"

// there doesn't seem to be any official way of getting info.type_data during creation :(
#ifdef __WINDOWS__
typedef void *pthread_mutex_t;
#endif

struct obs_context_data
{
Expand Down

0 comments on commit 85dd2b7

Please sign in to comment.