Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[msvc] Support MSVC 12/14 bindings generation and builds #270

Merged
merged 3 commits into from Aug 9, 2016
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Switch jsglue build to cmake

  • Loading branch information
vvuk committed Aug 5, 2016
commit 60d2cd4fa83c9a2b6539821729fcfb02883c577b
@@ -0,0 +1,35 @@
project(rust-mozjs)
cmake_minimum_required(VERSION 2.6)

set(DUMMY ${CMAKE_BUILD_TYPE})

set(SOURCES
src/jsglue.cpp
)

include_directories($ENV{DEP_MOZJS_OUTDIR}/dist/include)

if(MSVC)
if(NOT "$ENV{CARGO_FEATURE_DEBUGMOZJS}" STREQUAL "")
add_definitions(-MDd -Od -DDEBUG -D_DEBUG)
else()
add_definitions(-MD)
endif()
add_definitions(-FI$ENV{DEP_MOZJS_OUTDIR}/js/src/js-confdefs.h)
add_definitions(-DWIN32)
add_definitions(-Zi -GR-)
else()
if(NOT "$ENV{CARGO_FEATURE_DEBUGMOZJS}" STREQUAL "")
add_definitions(-g -O0 -DDEBUG -D_DEBUG)
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_definitions(-Wno-c++0x-extensions -Wno-return-type-c-linkage -Wno-invalid-offsetof)
endif()
add_definitions(-fPIC -fno-rtti)
add_definitions(-std=c++11 -DJS_NO_JSVAL_JSID_STRUCT_TYPES)
add_definitions(-include $ENV{DEP_MOZJS_OUTDIR}/js/src/js-confdefs.h)
endif()

add_library(jsglue STATIC ${SOURCES})
install(TARGETS jsglue ARCHIVE DESTINATION lib)

@@ -3,9 +3,11 @@
name = "js"
version = "0.1.3"
authors = ["The Servo Project Developers"]

build = "build.rs"

[build-dependencies]
cmake = "0.1"

[[test]]
name = "callback"
[[test]]
@@ -2,17 +2,10 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

use std::env;
use std::process::{Command, Stdio};
extern crate cmake;

fn main() {
let result = Command::new("make")
.args(&["-R", "-f", "makefile.cargo"])
.stdout(Stdio::inherit())
.stderr(Stdio::inherit())
.status()
.unwrap();
assert!(result.success());
println!("cargo:rustc-link-search=native={}", env::var("OUT_DIR").unwrap());
let dst = cmake::Config::new(".").build();
println!("cargo:rustc-link-search=native={}/lib", dst.display());
println!("cargo:rustc-link-lib=static=jsglue");
}

This file was deleted.

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.