Skip to content

Commit

Permalink
[BUILD] restrict runtime include headers (apache#1444)
Browse files Browse the repository at this point in the history
  • Loading branch information
tqchen authored and sergei-mironov committed Aug 8, 2018
1 parent 4b8ee8d commit d39dfd0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
18 changes: 14 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,8 @@ tvm_option(USE_RANDOM "Build with random support" OFF)

# include directories
include_directories("include")
include_directories("nnvm/include")
include_directories("dmlc-core/include")
include_directories("HalideIR/src")
include_directories("dlpack/include")
include_directories("topi/include")
include_directories("dmlc-core/include")

# initial variables
set(TVM_LINKER_LIBS "")
Expand Down Expand Up @@ -169,6 +166,19 @@ target_link_libraries(tvm_topi tvm ${TVM_LINKER_LIBS} ${TVM_RUNTIME_LINKER_LIBS}
target_link_libraries(tvm_runtime ${TVM_RUNTIME_LINKER_LIBS})
target_link_libraries(nnvm_compiler tvm)

# Related headers
target_include_directories(
tvm
PUBLIC "HalideIR/src"
PUBLIC "topi/include")
target_include_directories(
tvm_topi
PUBLIC "topi/include")
target_include_directories(
nnvm_compiler
PUBLIC "nnvm/include"
PUBLIC "topi/include")

# Tests
set(TEST_EXECS "")
file(GLOB TEST_SRCS tests/cpp/*.cc)
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ifndef DLPACK_PATH
DLPACK_PATH = $(ROOTDIR)/dlpack
endif

INCLUDE_FLAGS = -Iinclude -I$(DLPACK_PATH)/include -I$(DMLC_CORE_PATH)/include -IHalideIR/src -Itopi/include
INCLUDE_FLAGS = -Iinclude -I$(DLPACK_PATH)/include -I$(DMLC_CORE_PATH)/include
PKG_CFLAGS = -std=c++11 -Wall -O2 $(INCLUDE_FLAGS) -fPIC
PKG_LDFLAGS =

Expand Down
2 changes: 1 addition & 1 deletion apps/howto_deploy/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ PKG_CFLAGS = -std=c++11 -O2 -fPIC\
-I${DMLC_CORE}/include\
-I${TVM_ROOT}/dlpack/include\

PKG_LDFLAGS = -L${TVM_ROOT}/lib -ldl -lpthread
PKG_LDFLAGS = -L${TVM_ROOT}/build -ldl -lpthread

.PHONY: clean all

Expand Down

0 comments on commit d39dfd0

Please sign in to comment.