Output object file in current directory.
This commit is contained in:
parent
35d3dbce75
commit
3f19125574
|
@ -65,7 +65,7 @@ elseif(BISON_VERSION VERSION_LESS 3.0)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
## 3. External components
|
## 3. External components
|
||||||
find_package(Boost 1.48 REQUIRED regex)
|
find_package(Boost 1.48 REQUIRED regex system filesystem)
|
||||||
find_package(LLVM REQUIRED CONFIG)
|
find_package(LLVM REQUIRED CONFIG)
|
||||||
|
|
||||||
add_definitions(
|
add_definitions(
|
||||||
|
|
9
main.cpp
9
main.cpp
|
@ -27,6 +27,7 @@
|
||||||
#include <llvm/Support/raw_os_ostream.h>
|
#include <llvm/Support/raw_os_ostream.h>
|
||||||
|
|
||||||
#include <boost/regex.hpp>
|
#include <boost/regex.hpp>
|
||||||
|
#include <boost/filesystem.hpp>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
@ -53,12 +54,12 @@ int main(int argc, char **argv) {
|
||||||
parser.parse();
|
parser.parse();
|
||||||
|
|
||||||
boost::regex namere("^(.+)\\.mc$");
|
boost::regex namere("^(.+)\\.mc$");
|
||||||
std::string outputname;
|
std::string outputname = boost::filesystem::path(inputname).filename().native();
|
||||||
|
|
||||||
if (boost::regex_match(inputname, namere)) {
|
if (boost::regex_match(outputname, namere)) {
|
||||||
outputname = boost::regex_replace(inputname, namere, "$1.bc");
|
outputname = boost::regex_replace(outputname, namere, "$1.bc");
|
||||||
} else {
|
} else {
|
||||||
outputname = inputname + ".bc";
|
outputname = outputname + ".bc";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!program.emit(&emitter)) return 1;
|
if (!program.emit(&emitter)) return 1;
|
||||||
|
|
Reference in New Issue
Block a user