Merge pull request #8 from erickt/master

Add support for cargo
This commit is contained in:
Colin Sherratt
2014-06-26 12:27:08 -04:00
4 changed files with 41 additions and 4 deletions

7
.gitignore vendored Normal file
View File

@ -0,0 +1,7 @@
/.tmp.txt
/Makefile
/bin
/lib
/modules/oculus_sdk_mac/LibOVR/Lib/Mac/Xcode/Release/
/target
*.py[co]

23
Cargo.toml Normal file
View File

@ -0,0 +1,23 @@
[package]
name = "ovr-rs"
version = "0.1.0"
authors = [
"Colin Sherratt",
"Erick Tryzelaar"
]
build = "./scripts/compile-for-cargo"
[[lib]]
name = "ovr-rs"
path = "src/oculus-vr/lib.rs"
[[bin]]
name = "oculus-info"
path = "src/oculus-info/main.rs"
[dependencies.cgmath-rs]
git = "https://github.com/bjz/cgmath-rs.git"

View File

@ -182,7 +182,7 @@ class LibXcodebuild(Module):
self.dep_modules = []
def make_rule(self, mods):
out = "%s: %s\n" % (self.get_ename(),
out = "%s: lib %s\n" % (self.get_ename(),
" ".join(mods[m].get_ename() for m in self.dep_modules))
out += "\txcodebuild -project %s build\n\tcp %s lib\n" % (
self.get_path_to_xcode_project(), self.get_path_to_output_dir()
@ -221,7 +221,7 @@ class LibMakefile(Module):
self.dep_modules = []
def make_rule(self, mods):
out = "%s: %s %s\n" % (self.get_ename(),
out = "%s: lib %s %s\n" % (self.get_ename(),
self.get_path_to_makefile_dir() + "Makefile",
" ".join(mods[m].get_ename() for m in self.dep_modules))
out += "\tmake -j 16 -C %s\n\tcp %s lib\n" % (
@ -238,7 +238,7 @@ class LibConfigureMakefile(LibMakefile):
out += "\tcd %s && ./configure\n\n" % (
os.path.join(self.get_path_to_makefile_dir())
)
out += "%s: %s\n" % (self.get_ename(), os.path.join(self.get_path_to_makefile_dir(), "Makefile"))
out += "%s: lib %s\n" % (self.get_ename(), os.path.join(self.get_path_to_makefile_dir(), "Makefile"))
out += "\tmake -j 16 -C %s\n\tcp %s lib\n" % (
self.get_path_to_makefile_dir(), self.get_path_to_output_dir()
)
@ -276,7 +276,7 @@ class LibCMake(Module):
def make_rule(self, mods):
out = "%s:\n" % (self.get_path_to_makefile_dir() + "Makefile")
out += "\tcd %s && cmake %s .\n\n" % (self.get_path_to_makefile_dir(), self.cmake_flags)
out += "%s: %s %s\n" % (self.get_ename(),
out += "%s: lib %s %s\n" % (self.get_ename(),
self.get_path_to_makefile_dir() + "Makefile",
" ".join(mods[m].get_ename() for m in self.dep_modules))
out += "\tmake -j 16 -C %s && cp %s lib\n" % (

7
scripts/compile-for-cargo Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
set -e
./configure
make lib/libovr.a
cp lib/libovr.a target/