-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from loki04/servo
Adopt Servo project
- Loading branch information
Showing
6 changed files
with
106 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
[submodule "src/CMSIS"] | ||
path = src/CMSIS | ||
url = https://github.com/ARM-software/CMSIS | ||
[submodule "src/servo"] | ||
path = src/servo | ||
url = https://github.com/servo/servo.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
cmake_minimum_required(VERSION 2.8 FATAL_ERROR) | ||
include(ExternalProject) | ||
|
||
project (servo) | ||
|
||
set (PROJECT_SOURCE_DIR ${CSiBE_SRC_DIR}/${PROJECT_NAME}) | ||
set (PROJECT_INCLUDE_DIR ${PROJECT_SOURCE_DIR}) | ||
set (PROJECT_GEN_DIR ${CSiBE_GEN_DIR}/${PROJECT_NAME}) | ||
|
||
set (SIZE_RESULT "${PROJECT_BINARY_DIR}/result.csv") | ||
|
||
set (ENV{SERVO_CACHE_DIR} ${PROJECT_BINARY_DIR}/.servo) | ||
set (ENV{CARGO_HOME} ${PROJECT_BINARY_DIR}/.cargo) | ||
set (ENV{CARGO_TARGET_DIR} ${PROJECT_BINARY_DIR}/target) | ||
|
||
# Uncomment to add additional compiler flags | ||
# set (ENV{CSiBE_RUSTCFLAGS} "-C opt-level=0") | ||
|
||
execute_process(COMMAND ${PROJECT_SOURCE_DIR}/mach bootstrap-rust) | ||
execute_process(COMMAND ${PROJECT_GEN_DIR}/setup-csibe.py ${PROJECT_BINARY_DIR}/.servo) | ||
execute_process(COMMAND ${PROJECT_SOURCE_DIR}/mach bootstrap-cargo) | ||
execute_process(COMMAND ${PROJECT_SOURCE_DIR}/mach build -r) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/python | ||
|
||
import sys | ||
import subprocess | ||
import os | ||
|
||
if __name__ == '__main__': | ||
done = False | ||
rsfile = False | ||
addopts = os.getenv('CSiBE_RUSTCFLAGS','').split() | ||
|
||
cmd = ['rustc-orig'] | ||
|
||
for arg in sys.argv[1:]: | ||
if "--" == arg: | ||
cmd.extend(addopts) | ||
done = True | ||
elif ".rs" in arg: | ||
rsfile = True | ||
cmd.append(arg) | ||
|
||
if rsfile: | ||
if not done: | ||
cmd.extend(addopts) | ||
else: | ||
cmd = ['rustc-orig'] | ||
cmd.extend(sys.argv[1:]) | ||
|
||
sys.exit(subprocess.call(cmd)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/python | ||
|
||
import fnmatch | ||
import os | ||
import sys | ||
import shutil | ||
|
||
if __name__ == '__main__': | ||
if len(sys.argv) <= 1: | ||
sys.exit(1) | ||
|
||
path = sys.argv[1] | ||
|
||
match = None | ||
for root, dirnames, filenames in os.walk(path): | ||
for filename in fnmatch.filter(filenames, 'rustc'): | ||
match = os.path.join(root, filename) | ||
break | ||
|
||
if not match: | ||
sys.exit(1) | ||
|
||
wrapper = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'rustc-wrapper.py') | ||
|
||
original = match + "-orig" | ||
if os.path.isfile(original): | ||
sys.exit(2) | ||
|
||
os.rename(match, original) | ||
shutil.copy2(wrapper, match) |