Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Nov 20, 2023
1 parent 04aab10 commit 3f26f22
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions stubs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ endmacro(LOAD_STUBGEN)
#
# Generate the stubs associated to a given project. If optional arguments (which
# should be CMake targets) are supplied, then the stubs will only be generated
# after every specified target is built.
# On windows, the PATH will also be modified to find the provided targets.
# after every specified target is built. On windows, the PATH will also be
# modified to find the provided targets.
#
# .rst: .. variable:: module_path
#
Expand Down Expand Up @@ -97,15 +97,16 @@ function(GENERATE_STUBS module_path module_name module_install_dir)
set(PYTHONPATH ${module_path})
endif($ENV{PYTHONPATH})

# On windows, modify the PATH to find dependencies
# This avoid linking issue (there is no RPATH on windows)
# On windows, modify the PATH to find dependencies This avoid linking issue
# (there is no RPATH on windows)
set(ENV_PATH)
set(optional_args ${ARGN})
if(WIN32)
set(_path $ENV{PATH})
foreach(py_target IN LISTS optional_args)
if(TARGET ${py_target})
set(_is_lib "$<STREQUAL:$<TARGET_PROPERTY:${py_target},TYPE>,SHARED_LIBRARY>")
set(_is_lib
"$<STREQUAL:$<TARGET_PROPERTY:${py_target},TYPE>,SHARED_LIBRARY>")
set(_target_dir "$<TARGET_FILE_DIR:${py_target}>")
set(_path "$<${_is_lib}:${_target_dir}\\\;>${_path}")
endif()
Expand Down

0 comments on commit 3f26f22

Please sign in to comment.