Skip to content

Commit a8ede8b

Browse files
committed
odb: Move messages checking to odb to fix deps.
The messages checking was set at db level as odb is an interface and doesn't not have a post-build trigger. Unfortunately there were no dependencies on other libs besides db such as defin. So since add_dependencies can only add targets but not files, create a custom target which depends on a generated files which triggers the call to find_messages.py. Signed-off-by: Christian Costa <titan.costa@gmail.com>
1 parent 9c48043 commit a8ede8b

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

src/odb/CMakeLists.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,22 @@ if(ENABLE_TESTS)
8181
odb
8282
)
8383
endif()
84+
85+
add_custom_command(
86+
OUTPUT messages_checked
87+
COMMAND ${CMAKE_SOURCE_DIR}/etc/find_messages.py > messages.txt && touch ${CMAKE_CURRENT_BINARY_DIR}/messages_checked
88+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
89+
DEPENDS
90+
db
91+
cdl
92+
defin
93+
defout
94+
lefin
95+
lefout
96+
zutil
97+
gdsin
98+
)
99+
100+
add_custom_target(odb_messages DEPENDS messages_checked)
101+
102+
add_dependencies(odb odb_messages)

src/odb/src/db/CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,3 @@ target_link_libraries(db
179179
utl_lib
180180
${TCL_LIBRARY}
181181
)
182-
183-
messages(
184-
TARGET db
185-
OUTPUT_DIR ../..
186-
SOURCE_DIR ../..
187-
)

0 commit comments

Comments
 (0)