Skip to content

Commit

Permalink
shiboken: use response files for shiboken calls
Browse files Browse the repository at this point in the history
  • Loading branch information
mathstuf committed Apr 15, 2015
1 parent f9c5087 commit a03b0a8
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions CMake/UseShiboken.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -233,16 +233,29 @@ function(sbk_wrap_library NAME)
if(_GENERATOR_ARGS)
list(APPEND _shiboken_options ${_GENERATOR_ARGS})
endif()
list(APPEND _shiboken_options
"--output-directory=${CMAKE_CURRENT_BINARY_DIR}"
)

set(arg_file "${CMAKE_CURRENT_BINARY_DIR}/shiboken-${NAME}.args")
file(WRITE "${arg_file}.tmp" "")
foreach (arg IN LISTS _shiboken_options)
file(APPEND "${arg_file}.tmp" "${arg}\n")
endforeach ()
file(APPEND "${arg_file}.tmp" "--include-paths=${_includes}\n")
file(APPEND "${arg_file}.tmp" "--typesystem-paths=${_typesystem_paths}\n")

configure_file(
"${arg_file}.tmp"
"${arg_file}"
COPYONLY)

add_custom_command(
OUTPUT ${_sources}
DEPENDS ${_typesystem} ${_global_header} ${_depends} ${_typesystem_depends}
COMMAND "${SHIBOKEN_BINARY}"
${_shiboken_options}
"@${arg_file}"
"${_global_header}"
"--include-paths=${_includes}"
"--typesystem-paths=${_typesystem_paths}"
"--output-directory=${CMAKE_CURRENT_BINARY_DIR}"
"${_typesystem}"
WORKING_DIRECTORY ${_WORKING_DIRECTORY}
COMMENT "Generating Python bindings for ${NAME}"
Expand Down

0 comments on commit a03b0a8

Please sign in to comment.