Commit 92430c2e authored by Jaikrishnan Menon's avatar Jaikrishnan Menon

CPU: Add CMake glue to populate header search paths

Also disable PCH in preparation of merge
parent 46840954
......@@ -101,7 +101,8 @@ include_directories(
if(LLVM_INCLUDE_DIR)
include_directories(SYSTEM ${LLVM_INCLUDE_DIR})
link_directories(${LLVM_LIB_DIR})
# Add sources for the LLVM-based code generator
# Add sources for the CPU backend
# and all its dependencies
set(SRC ${SRC}
codegen/compiler.cpp
runtime/cpu/call_frame.cpp
......@@ -110,7 +111,10 @@ if(LLVM_INCLUDE_DIR)
runtime/cpu/emitter.cpp
runtime/cpu/external_function.cpp
)
# LLVM binary builds are typically built without RTTI
set_source_files_properties(codegen/compiler.cpp PROPERTIES COMPILE_FLAGS "-fno-rtti")
set_source_files_properties(codegen/compiler.cpp PROPERTIES COMPILE_DEFINITIONS
"EIGEN_HEADERS_PATH=\"${EIGEN_INCLUDE_DIR}\";CLANG_BUILTIN_HEADERS_PATH=\"${LLVM_LIB_DIR}/clang/5.0.0/include\";NGRAPH_HEADERS_PATH=\"${NGRAPH_INCLUDE_PATH}\"")
endif()
add_library(ngraph SHARED ${SRC})
......
......@@ -123,7 +123,7 @@ std::unique_ptr<llvm::Module> execution_state::compile(const string& source, con
// But that's a private header and isn't part of the public libclang API
// Instead of re-implementing all of that functionality in a custom toolchain
// just hardcode the paths relevant to frequently used build/test machines for now
HSO.AddPath("/localdisk/menonjai/build/third-party/ext_llvm-prefix/src/ext_llvm/lib/clang/5.0.0/include", clang::frontend::System, false, false);
HSO.AddPath(CLANG_BUILTIN_HEADERS_PATH, clang::frontend::System, false, false);
HSO.AddPath("/usr/include/x86_64-linux-gnu", clang::frontend::System, false, false);
HSO.AddPath("/usr/include", clang::frontend::System, false, false);
// Add C++ standard library headers
......@@ -133,12 +133,8 @@ std::unique_ptr<llvm::Module> execution_state::compile(const string& source, con
// Debian-like + GCC 5 libstdc++
HSO.AddPath("/usr/include/x86_64-linux-gnu/c++/5", clang::frontend::System, false, false);
HSO.AddPath("/usr/include/c++/5", clang::frontend::System, false, false);
// TODO: Hack in path to eigen headers for now
HSO.AddPath("/localdisk/menonjai/build/external/eigen/include/eigen3",
clang::frontend::System,
false,
false);
HSO.AddPath("/home/menonjai/ngraph-cpp/src", clang::frontend::System, false, false);
HSO.AddPath(EIGEN_HEADERS_PATH, clang::frontend::System, false, false);
HSO.AddPath(NGRAPH_HEADERS_PATH, clang::frontend::System, false, false);
// Language options
auto LO = Clang->getInvocation().getLangOpts();
......
......@@ -61,7 +61,7 @@
// TODO: Decide if we want to ship this or
// just enable it for developer build-test cycles
#define NGCPU_PCH
//#define NGCPU_PCH
using namespace std;
using namespace ngraph::runtime::cpu;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment