Skip to content

Commit

Permalink
Fix race condition in CMake code. (#1555)
Browse files Browse the repository at this point in the history
The race is cause by the fact that two targets exist to copy the Python
files. The first one because of `cpp_cc_build_time_copy` without
`NO_TARGET`. The second because of the:

    add_custom_target(nmodl_copy_python_files ALL DEPENDS ...)

The solution is to not create the per file target by passing
`NO_TARGET` to `cpp_cc_build_time_copy`.
  • Loading branch information
1uc authored Nov 7, 2024
1 parent 25da002 commit 1f0c5c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pybind/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ file(

foreach(file IN LISTS NMODL_PYTHON_FILES)
cpp_cc_build_time_copy(INPUT ${NMODL_PROJECT_SOURCE_DIR}/python/nmodl/${file} OUTPUT
${CMAKE_BINARY_DIR}/lib/nmodl/${file})
${CMAKE_BINARY_DIR}/lib/nmodl/${file} NO_TARGET)
list(APPEND nmodl_python_binary_dir_files "${CMAKE_BINARY_DIR}/lib/nmodl/${file}")
endforeach()
add_custom_target(nmodl_copy_python_files ALL DEPENDS ${nmodl_python_binary_dir_files})
Expand Down

0 comments on commit 1f0c5c1

Please sign in to comment.