@@ -2,13 +2,14 @@ cmake_minimum_required(VERSION 3.9)
2
2
3
3
project ("libarchfpga" )
4
4
5
- file (GLOB_RECURSE EXEC_SOURCES src/main.cpp )
5
+ file (GLOB_RECURSE READ_ARCH_EXEC_SRC src/main.cpp )
6
+ file (GLOB_RECURSE WRITE_ARCH_BB_EXEC_SRC src/write_arch_bb.cpp )
6
7
file (GLOB_RECURSE LIB_SOURCES src/*.cpp )
7
8
file (GLOB_RECURSE LIB_HEADERS src/*.h )
8
9
files_to_dirs (LIB_HEADERS LIB_INCLUDE_DIRS )
9
10
10
11
#Remove test executable from library
11
- list (REMOVE_ITEM LIB_SOURCES ${EXEC_SOURCES } )
12
+ list (REMOVE_ITEM LIB_SOURCES ${READ_ARCH_EXEC_SRC} ${WRITE_ARCH_BB_EXEC_SRC } )
12
13
13
14
#Create the library
14
15
add_library (libarchfpga STATIC
@@ -31,16 +32,40 @@ target_link_libraries(libarchfpga
31
32
target_compile_definitions (libarchfpga PUBLIC ${INTERCHANGE_SCHEMA_HEADERS} )
32
33
33
34
#Create the test executable
34
- add_executable (read_arch ${EXEC_SOURCES} )
35
+ add_executable (read_arch ${READ_ARCH_EXEC_SRC} )
36
+ add_executable (write_arch_bb ${WRITE_ARCH_BB_EXEC_SRC} )
35
37
target_link_libraries (read_arch libarchfpga )
38
+ target_link_libraries (write_arch_bb libarchfpga )
36
39
37
40
#Supress IPO link warnings if IPO is enabled
38
41
get_target_property (READ_ARCH_USES_IPO read_arch INTERPROCEDURAL_OPTIMIZATION )
42
+ get_target_property (WRITE_ARCH_BB_USES_IPO write_arch_bb INTERPROCEDURAL_OPTIMIZATION )
39
43
if (READ_ARCH_USES_IPO )
40
44
set_property (TARGET read_arch APPEND PROPERTY LINK_FLAGS ${IPO_LINK_WARN_SUPRESS_FLAGS} )
41
45
endif ()
46
+ if (WRITE_ARCH_BB_USES_IPO )
47
+ set_property (TARGET write_arch_bb APPEND PROPERTY LINK_FLAGS ${IPO_LINK_WARN_SUPRESS_FLAGS} )
48
+ endif ()
49
+
50
+ install (TARGETS libarchfpga read_arch write_arch_bb DESTINATION bin )
42
51
43
- install (TARGETS libarchfpga read_arch DESTINATION bin )
52
+ #
53
+ # install executables in the VTR source root directory
54
+ # to utilize them for scripts running VTR flow
55
+ #
56
+ set (ARCHFPGA_DIR ${VTR_SOURCE_DIR} /ArchFPGA )
57
+ # making a new custom target out of libarchfpga to automatically perform
58
+ # the house keeping for end users by deleting the ArchFPGA dir in the
59
+ # VTR root dir if it exists and holds expired execs
60
+ add_custom_target (archfpga-execs ALL
61
+ DEPENDS read_arch write_arch_bb
62
+ COMMAND ${CMAKE_COMMAND} -E
63
+ remove_directory ${ARCHFPGA_DIR}
64
+ COMMAND ${CMAKE_COMMAND} -E
65
+ make_directory ${ARCHFPGA_DIR}
66
+ COMMAND ${CMAKE_COMMAND} -E
67
+ copy_directory ${CMAKE_CURRENT_BINARY_DIR} ${ARCHFPGA_DIR}
68
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )
44
69
45
70
#
46
71
# Unit Tests
0 commit comments