memgraph/src/query_engine/code_compiler.hpp

26 lines
725 B
C++
Raw Normal View History

#pragma once
#include <string>
#include "utils/string/join.hpp"
class CodeCompiler
{
public:
void compile(const std::string &in_file, const std::string &out_file)
{
auto compile_command =
utils::prints("clang++",
// "-std=c++1y -O2 -DNDEBUG", // compile flags
"-std=c++1y", // compile flags
in_file, // input file
"-o", out_file, // ouput file
"-I../", // include paths
"-shared -fPIC" // shared library flags
);
2016-02-11 06:34:49 +08:00
// synchronous call
system(compile_command.c_str());
}
};