fix build setup

This commit is contained in:
Eyck Jentzsch 2021-05-13 14:03:10 +02:00
parent a1fa8877f7
commit f2bf6d682a
1 changed files with 14 additions and 16 deletions

View File

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.12)
project(tgc VERSION 1.0.0)
project(dbt-core-tgc VERSION 1.0.0)
include(GNUInstallDirs)
@ -27,19 +27,17 @@ endif()
add_subdirectory(softfloat)
# library files
FILE(GLOB RiscVSCHeaders ${CMAKE_CURRENT_SOURCE_DIR}/incl/sysc/*.h ${CMAKE_CURRENT_SOURCE_DIR}/incl/sysc/*/*.h)
set(LIB_HEADERS tgfscVSCHeaders} )
FILE(GLOB TGC_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/src/iss/*.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/vm/interp/vm_*.cpp
)
set(LIB_SOURCES
src/vm/fp_functions.cpp
src/plugin/instruction_count.cpp
src/plugin/cycle_estimate.cpp
${TGC_SOURCES}
)
if(EXISTS src/iss/tgf_b.cpp)
set(LIB_SOURCES ${LIB_SOURCES} src/iss/tgf_b.cpp src/vm/interp/vm_tgf_b.cpp)
endif()
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/iss/tgf_c.cpp)
set(LIB_SOURCES ${LIB_SOURCES} src/iss/tgf_c.cpp src/vm/interp/vm_tgf_c.cpp)
endif()
if(WITH_LLVM)
set(LIB_SOURCES ${LIB_SOURCES}
src/vm/llvm/fp_impl.cpp
@ -86,7 +84,7 @@ if(SystemC_FOUND)
)
endif()
project("tgc-sim")
project(tgc-sim)
add_executable(${PROJECT_NAME} src/main.cpp)
# This sets the include directory for the reference project. This is the -I flag in gcc.
@ -95,14 +93,14 @@ if(WITH_LLVM)
target_link_libraries(${PROJECT_NAME} PUBLIC ${llvm_libs})
endif()
# Links the target exe against the libraries
target_link_libraries(${PROJECT_NAME} tgc)
target_link_libraries(${PROJECT_NAME} dbt-core-tgc)
target_link_libraries(${PROJECT_NAME} jsoncpp)
target_link_libraries(${PROJECT_NAME} ${Boost_LIBRARIES} )
if (Tcmalloc_FOUND)
target_link_libraries(${PROJECT_NAME} ${Tcmalloc_LIBRARIES})
endif(Tcmalloc_FOUND)
install(TARGETS tgc tgc-sim
install(TARGETS dbt-core-tgc tgc-sim
EXPORT ${PROJECT_NAME}Targets # for downstream dependencies
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libs # static lib
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT libs # binaries