2020-01-22 21:20:10 -06:00
|
|
|
cmake_minimum_required(VERSION 3.9)
|
|
|
|
|
2022-08-18 13:34:01 -05:00
|
|
|
project("openfpga")
|
2020-01-22 21:20:10 -06:00
|
|
|
|
|
|
|
file(GLOB_RECURSE EXEC_SOURCE src/main.cpp)
|
|
|
|
file(GLOB_RECURSE LIB_SOURCES src/*/*.cpp)
|
|
|
|
file(GLOB_RECURSE LIB_HEADERS src/*/*.h)
|
|
|
|
files_to_dirs(LIB_HEADERS LIB_INCLUDE_DIRS)
|
|
|
|
|
|
|
|
#Remove test executable from library
|
|
|
|
list(REMOVE_ITEM LIB_SOURCES ${EXEC_SOURCE})
|
|
|
|
|
2022-12-01 14:06:27 -06:00
|
|
|
if (OPENFPGA_WITH_SWIG)
|
|
|
|
# SWIG library
|
2022-12-01 17:59:52 -06:00
|
|
|
SwigLib(NAME openfpga_shell
|
2022-12-01 14:30:57 -06:00
|
|
|
NAMESPACE std
|
2022-12-01 15:51:50 -06:00
|
|
|
LANGUAGE tcl
|
2022-12-01 17:59:52 -06:00
|
|
|
I_FILE src/openfpga_shell.i)
|
|
|
|
target_include_directories(openfpga_shell PUBLIC ${LIB_INCLUDE_DIRS})
|
|
|
|
target_link_libraries(openfpga_shell
|
2022-12-01 17:16:58 -06:00
|
|
|
libopenfpga)
|
2022-12-01 14:06:27 -06:00
|
|
|
endif()
|
|
|
|
|
2020-01-22 21:20:10 -06:00
|
|
|
#Create the library
|
2022-12-01 13:42:25 -06:00
|
|
|
#Static linked library for other C++ libraries
|
2020-01-22 21:20:10 -06:00
|
|
|
add_library(libopenfpga STATIC
|
|
|
|
${LIB_HEADERS}
|
|
|
|
${LIB_SOURCES})
|
|
|
|
target_include_directories(libopenfpga PUBLIC ${LIB_INCLUDE_DIRS})
|
|
|
|
set_target_properties(libopenfpga PROPERTIES PREFIX "") #Avoid extra 'lib' prefix
|
|
|
|
|
|
|
|
#Specify link-time dependancies
|
|
|
|
target_link_libraries(libopenfpga
|
2023-02-22 23:58:25 -06:00
|
|
|
libclkarchopenfpga
|
2020-01-22 21:20:10 -06:00
|
|
|
libarchopenfpga
|
|
|
|
libopenfpgashell
|
|
|
|
libopenfpgautil
|
2020-06-12 11:41:34 -05:00
|
|
|
libfabrickey
|
2020-06-20 19:25:17 -05:00
|
|
|
libfpgabitstream
|
2020-02-27 19:01:47 -06:00
|
|
|
libini
|
2021-01-19 17:56:30 -06:00
|
|
|
libpcf
|
2020-01-22 21:20:10 -06:00
|
|
|
libvtrutil
|
2022-02-17 19:28:55 -06:00
|
|
|
libbusgroup
|
2023-09-15 15:51:14 -05:00
|
|
|
libnamemanager
|
2023-07-14 14:13:31 -05:00
|
|
|
libtileconfig
|
2022-08-18 21:33:56 -05:00
|
|
|
libpugixml
|
2024-09-26 04:39:52 -05:00
|
|
|
libvpr
|
|
|
|
libopenfpgacapnproto
|
|
|
|
)
|
2020-01-22 21:20:10 -06:00
|
|
|
|
|
|
|
#Create the test executable
|
|
|
|
add_executable(openfpga ${EXEC_SOURCE})
|
|
|
|
target_link_libraries(openfpga libopenfpga)
|
|
|
|
|
2023-01-31 14:41:15 -06:00
|
|
|
if (OPENFPGA_ENABLE_STRICT_COMPILE)
|
|
|
|
message(STATUS "OpenFPGA: building with strict flags")
|
|
|
|
|
|
|
|
set(OPENFPGA_STRICT_COMPILE_FLAGS_TO_CHECK
|
|
|
|
#GCC-like
|
|
|
|
"-Werror"
|
|
|
|
# due to the pointer hackery in timing_driven_route_structs and BinaryHeap.heap_
|
|
|
|
"-Wno-error=free-nonheap-object"
|
|
|
|
)
|
|
|
|
|
|
|
|
foreach(flag ${OPENFPGA_STRICT_COMPILE_FLAGS_TO_CHECK})
|
|
|
|
message(STATUS "\tAdding CXX flag: ${flag}")
|
|
|
|
target_compile_options(libopenfpga PRIVATE ${flag})
|
|
|
|
target_compile_options(openfpga PRIVATE ${flag})
|
|
|
|
target_link_libraries(openfpga ${flag})
|
|
|
|
endforeach()
|
|
|
|
endif()
|
|
|
|
|
2022-08-24 23:51:29 -05:00
|
|
|
#Suppress IPO link warnings if IPO is enabled
|
2020-01-22 21:20:10 -06:00
|
|
|
get_target_property(OPENFPGA_USES_IPO openfpga INTERPROCEDURAL_OPTIMIZATION)
|
2022-08-24 16:34:33 -05:00
|
|
|
if (OPENFPGA_USES_IPO)
|
|
|
|
set_property(TARGET openfpga APPEND PROPERTY LINK_FLAGS ${IPO_LINK_WARN_SUPRESS_FLAGS})
|
2020-01-22 21:20:10 -06:00
|
|
|
endif()
|
|
|
|
|
|
|
|
install(TARGETS libopenfpga openfpga DESTINATION bin)
|