Created
April 9, 2011 17:38
-
-
Save jasonroelofs/911589 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#include <rubinius/environment.hpp> | |
#include <iostream> | |
using namespace rubinius; | |
int main(int argc, char** argv) { | |
Environment env(argc, argv); | |
env.setup_cpp_terminate(); | |
try { | |
const char* runtime = getenv("RBX_RUNTIME"); | |
if(!runtime) runtime = RBX_RUNTIME; | |
env.run_from_filesystem(runtime); | |
} catch(std::runtime_error& e) { | |
std::cout << "Runtime exception: " << e.what() << std::endl; | |
} catch(...) { | |
std::cout << "Unknown exception detected." << std::endl; | |
} | |
env.halt(); | |
return env.exit_code(); | |
} |
This file contains hidden or 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
require 'rbconfig' | |
config = RbConfig::CONFIG | |
FLAGS = %|-L#{config["libdir"]} -I#{config["includedir"]} -I#{config["includedir"]}/rubinius| | |
desc "Build the test with shared linkage" | |
task :build_shared do | |
cmd = "g++ #{FLAGS} #{config["LIBRUBYARG_SHARED"]} main.cpp -o main" | |
sh cmd | |
end | |
desc "Build the test with static linkage (fails badly with LLVM linker errors)" | |
task :build_static do | |
cmd = "g++ #{FLAGS} #{config["LIBRUBYARG_STATIC"]} main.cpp -o main" | |
sh cmd | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment