Unverified Commit 60fc850a authored by Robert Kimball's avatar Robert Kimball Committed by GitHub

cleanup header path defines (#483)

parent e931b2b6
......@@ -177,14 +177,23 @@ if (NGRAPH_CPU_ENABLE AND LLVM_INCLUDE_DIR AND
# The built-in headers are in a version-specific directory
# This must be kept in sync with the LLVM + Clang version in use
set_source_files_properties(codegen/compiler.cpp PROPERTIES COMPILE_FLAGS "-fno-rtti")
set(HEADER_SEARCH_DEFINES
"EIGEN_HEADERS_PATH=\"${EIGEN_INCLUDE_DIR}\""
"MKLDNN_HEADERS_PATH=\"${MKLDNN_INCLUDE_DIR}\""
"CLANG_BUILTIN_HEADERS_PATH=\"${LLVM_LIB_DIR}/clang/5.0.1/include\""
"NGRAPH_HEADERS_PATH=\"${NGRAPH_INCLUDE_PATH}\""
"INSTALLED_HEADERS_PATH=\"${CMAKE_INSTALL_PREFIX}/include\""
)
if (NGRAPH_TBB_ENABLE)
set_source_files_properties(codegen/compiler.cpp PROPERTIES COMPILE_DEFINITIONS
"EIGEN_HEADERS_PATH=\"${EIGEN_INCLUDE_DIR}\";MKLDNN_HEADERS_PATH=\"${MKLDNN_INCLUDE_DIR}\";CLANG_BUILTIN_HEADERS_PATH=\"${LLVM_LIB_DIR}/clang/5.0.1/include\";TBB_HEADERS_PATH=\"${TBB_ROOT}/include\";NGRAPH_HEADERS_PATH=\"${NGRAPH_INCLUDE_PATH}\";INSTALLED_HEADERS_PATH=\"${CMAKE_INSTALL_PREFIX}/include\";NGRAPH_TBB_ENABLE;")
set_source_files_properties(runtime/cpu/cpu_external_function.cpp PROPERTIES COMPILE_DEFINITIONS "NGRAPH_TBB_ENABLE")
else()
set_source_files_properties(codegen/compiler.cpp PROPERTIES COMPILE_DEFINITIONS
"EIGEN_HEADERS_PATH=\"${EIGEN_INCLUDE_DIR}\";MKLDNN_HEADERS_PATH=\"${MKLDNN_INCLUDE_DIR}\";CLANG_BUILTIN_HEADERS_PATH=\"${LLVM_LIB_DIR}/clang/5.0.1/include\";NGRAPH_HEADERS_PATH=\"${NGRAPH_INCLUDE_PATH}\";INSTALLED_HEADERS_PATH=\"${CMAKE_INSTALL_PREFIX}/include\";")
set(HEADER_SEARCH_DEFINES ${HEADER_SEARCH_DEFINES}
"TBB_HEADERS_PATH=\"${TBB_ROOT}/include\""
"NGRAPH_TBB_ENABLE"
)
endif()
set_source_files_properties(codegen/compiler.cpp PROPERTIES COMPILE_DEFINITIONS "${HEADER_SEARCH_DEFINES}")
set(NGRAPH_CPU_DEBUGINFO_ENABLE 0 CACHE STRING "Enable debuginfo in the CPU backend")
# GPU backend current requires CPU because they share compiler.cpp,
......
......@@ -25,7 +25,7 @@ if (NGRAPH_CPU_ENABLE AND NOT APPLE)
add_executable(resource_generator ${SRC})
add_dependencies(resource_generator ext_llvm eigen ext_mkldnn)
set(HEADER_PATHS
set(HEADER_SEARCH_DEFINES
"EIGEN_HEADERS_PATH=\"${EIGEN_INCLUDE_DIR}\""
"MKLDNN_HEADERS_PATH=\"${MKLDNN_INCLUDE_DIR}\""
"CLANG_BUILTIN_HEADERS_PATH=\"${LLVM_LIB_DIR}/clang/5.0.1/include\""
......@@ -33,16 +33,11 @@ if (NGRAPH_CPU_ENABLE AND NOT APPLE)
)
if(NGRAPH_TBB_ENABLE)
list(APPEND HEADER_PATHS "TBB_HEADERS_PATH=\"${TBB_ROOT}/include\"")
list(APPEND HEADER_SEARCH_DEFINES "TBB_HEADERS_PATH=\"${TBB_ROOT}/include\"")
set(HEADER_SEARCH_DEFINES ${HEADER_SEARCH_DEFINES} "NGRAPH_TBB_ENABLE")
endif()
if(NGRAPH_TBB_ENABLE)
set(NGRAPH_TBB_OPTION "NGRAPH_TBB_ENABLE")
else()
set(NGRAPH_TBB_OPTION "")
endif()
message("HEADER_PATHS ${HEADER_PATHS}")
message("HEADER_SEARCH_DEFINES ${HEADER_SEARCH_DEFINES}")
set_source_files_properties(main.cpp PROPERTIES COMPILE_DEFINITIONS "${HEADER_PATHS};${NGRAPH_TBB_OPTION}")
set_source_files_properties(main.cpp PROPERTIES COMPILE_DEFINITIONS "${HEADER_SEARCH_DEFINES}")
endif()
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