Skip to content

Commit

Permalink
[VTA] [CMake] hotfix tsim rules (apache#3650)
Browse files Browse the repository at this point in the history
  • Loading branch information
vegaluisjose authored and wweic committed Aug 9, 2019
1 parent 0e3b7e4 commit bae51f6
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions cmake/modules/VTA.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,17 @@ elseif(PYTHON)
if(${VTA_TARGET} STREQUAL "sim")
file(GLOB __vta_target_srcs vta/src/sim/*.cc)
endif()
# Add pynq driver sources
if(${VTA_TARGET} STREQUAL "pynq" OR ${VTA_TARGET} STREQUAL "ultra96")
file(GLOB __vta_target_srcs vta/src/pynq/*.cc)
endif()
list(APPEND VTA_RUNTIME_SRCS ${__vta_target_srcs})
# Add tsim driver sources
if(${VTA_TARGET} STREQUAL "tsim")
target_compile_definitions(vta PUBLIC USE_TSIM)
include_directories("vta/include")
file(GLOB __vta_target_srcs vta/src/tsim/*.cc)
file(GLOB RUNTIME_DPI_SRCS vta/src/dpi/module.cc)
list(APPEND RUNTIME_SRCS ${RUNTIME_DPI_SRCS})
endif()
# Add pynq driver sources
if(${VTA_TARGET} STREQUAL "pynq" OR ${VTA_TARGET} STREQUAL "ultra96")
file(GLOB __vta_target_srcs vta/src/pynq/*.cc)
endif()
list(APPEND VTA_RUNTIME_SRCS ${__vta_target_srcs})

add_library(vta SHARED ${VTA_RUNTIME_SRCS})

Expand All @@ -64,6 +63,12 @@ elseif(PYTHON)
target_compile_definitions(vta PUBLIC ${__strip_def})
endforeach()

# Enable tsim macro
if(${VTA_TARGET} STREQUAL "tsim")
include_directories("vta/include")
target_compile_definitions(vta PUBLIC USE_TSIM)
endif()

if(APPLE)
set_target_properties(vta PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
endif(APPLE)
Expand Down

0 comments on commit bae51f6

Please sign in to comment.