@@ -3,20 +3,24 @@ generic_flex(ansi_c)
3
3
4
4
add_executable (converter library/converter.cpp)
5
5
6
+ file (GLOB ansi_c_library_sources "library/*.c" )
7
+
6
8
add_custom_command (OUTPUT converter_input.txt
7
- COMMAND cat ${CMAKE_CURRENT_SOURCE_DIR} /library/*.c > converter_input.txt
9
+ COMMAND cat ${ansi_c_library_sources} > converter_input.txt
10
+ DEPENDS ${ansi_c_library_sources}
8
11
)
9
12
10
- add_custom_command (OUTPUT ${CMAKE_CURRENT_BINARY_DIR} /cprover_library.inc
11
- COMMAND converter < converter_input.txt > ${CMAKE_CURRENT_BINARY_DIR} /cprover_library.inc
12
- DEPENDS converter_input.txt
13
+ add_custom_command (OUTPUT " ${CMAKE_CURRENT_BINARY_DIR} /cprover_library.inc"
14
+ COMMAND converter < " converter_input.txt" > " ${CMAKE_CURRENT_BINARY_DIR} /cprover_library.inc"
15
+ DEPENDS " converter_input.txt" converter
13
16
)
14
17
15
18
add_executable (file_converter file_converter.cpp)
16
19
17
20
function (make_inc name )
18
- add_custom_command (OUTPUT ${CMAKE_CURRENT_BINARY_DIR} /${name} .inc
19
- COMMAND file_converter < ${CMAKE_CURRENT_SOURCE_DIR} /${name} .h > ${CMAKE_CURRENT_BINARY_DIR} /${name} .inc
21
+ add_custom_command (OUTPUT "${CMAKE_CURRENT_BINARY_DIR} /${name} .inc"
22
+ COMMAND file_converter < "${CMAKE_CURRENT_SOURCE_DIR} /${name} .h" > "${CMAKE_CURRENT_BINARY_DIR} /${name} .inc"
23
+ DEPENDS "${CMAKE_CURRENT_SOURCE_DIR} /${name} .h" file_converter
20
24
)
21
25
endfunction (make_inc)
22
26
@@ -70,13 +74,7 @@ make_inc(gcc_builtin_headers_power)
70
74
make_inc(gcc_builtin_headers_tm)
71
75
make_inc(gcc_builtin_headers_ubsan)
72
76
73
- file (GLOB_RECURSE sources "*.cpp" )
74
- file (GLOB_RECURSE headers "*.h" )
75
- add_library (ansi-c
76
- ${sources}
77
- ${headers}
78
- ${BISON_parser_OUTPUTS}
79
- ${FLEX_scanner_OUTPUTS}
77
+ set (extra_dependencies
80
78
${CMAKE_CURRENT_BINARY_DIR} /arm_builtin_headers.inc
81
79
${CMAKE_CURRENT_BINARY_DIR} /clang_builtin_headers.inc
82
80
${CMAKE_CURRENT_BINARY_DIR} /cprover_library.inc
@@ -98,6 +96,27 @@ add_library(ansi-c
98
96
${CMAKE_CURRENT_BINARY_DIR} /library-check.stamp
99
97
)
100
98
99
+ file (GLOB_RECURSE sources "*.cpp" )
100
+ file (GLOB_RECURSE headers "*.h" )
101
+
102
+ list (REMOVE_ITEM sources
103
+ "${CMAKE_CURRENT_SOURCE_DIR} /library/converter.cpp"
104
+ "${CMAKE_CURRENT_SOURCE_DIR} /file_converter.cpp"
105
+ )
106
+
107
+ add_library (ansi-c
108
+ ${sources}
109
+ ${headers}
110
+ ${BISON_parser_OUTPUTS}
111
+ ${FLEX_scanner_OUTPUTS}
112
+ )
113
+
114
+ set_source_files_properties (
115
+ ${sources}
116
+ PROPERTIES
117
+ OBJECT_DEPENDS "${extra_dependencies} "
118
+ )
119
+
101
120
generic_includes(ansi-c)
102
121
103
122
target_link_libraries (ansi-c util linking goto-programs assembler)
0 commit comments