Skip to content

Commit

Permalink
[cmake] Force omniidl -bpython to run sequentially
Browse files Browse the repository at this point in the history
Otherwise we face a race condition when some files created by an omniidl
process are moved by another omniidl process under its nose.
  • Loading branch information
gergondet committed Sep 7, 2022
1 parent 5acd854 commit 10393d0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions hrplib/hrpCorba/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ foreach(name ${IDL_FILE_BASENAMES})
set(idl_py_files ${idl_py_files} ${CMAKE_CURRENT_BINARY_DIR}/${name}_idl.py)
endforeach()

set(idl_py_depends)
foreach(idl_basename ${IDL_FILE_BASENAMES})
set(idl_file ${OPENHRP_IDL_DIR}/OpenHRP/${idl_basename}.idl)
if(UNIX)
Expand All @@ -30,7 +31,7 @@ foreach(idl_basename ${IDL_FILE_BASENAMES})
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${idl_basename}_idl.py
COMMAND omniidl ${idl_flags_py} ${idl_file}
DEPENDS ${idl_files}
DEPENDS ${idl_files} ${idl_py_depends}
)
elseif(WIN32)
add_custom_command(
Expand All @@ -43,9 +44,10 @@ foreach(idl_basename ${IDL_FILE_BASENAMES})
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${idl_basename}_idl.py
COMMAND set PATH= "${OMNIORB_DIR}/bin/x86_win32"\;%PATH%
COMMAND omniidl ${idl_flags_py} ${idl_file}
DEPENDS ${idl_files}
DEPENDS ${idl_files} ${idl_py_depends}
)
endif()
set(idl_py_depends ${idl_py_depends} ${CMAKE_CURRENT_BINARY_DIR}/${idl_basename}_idl.py)
endforeach()

set(target hrpCorbaStubSkel-${OPENHRP_LIBRARY_VERSION})
Expand Down

0 comments on commit 10393d0

Please sign in to comment.