Commit a701e9c0 authored by Ben Boeckel's avatar Ben Boeckel
Browse files

windows: compile the vtkpython.rc file separately

On Windows, if a build tree has a long path, the command line length
limit can be exceeded. This is normally handled by using response files
to store the command line arguments rather than passing them directly.
Unfortunately, CMake does not support this for RC files. To address
this, compile the rc file separately.

Change-Id: Ie91e9578c6cf41f7386b914e408c6369c733117f
parent 18a804f8
if (WIN32)
if (building_vtkpythonrc)
# XXX: With long paths, this command line can get too long because of all
# the include directories required for vtkpython to work. The thing is that
# CMake's RC rule in Ninja does not support response files, so the path can
# end up way too long. Since this doesn't need those include paths, act as
# if it is in a separate directory to avoid all the include_directories
# used here.
add_library(vtkpythonrc STATIC dummy.cxx vtkpython.rc)
else ()
set(building_vtkpythonrc TRUE)
# Make a separate directory scope for building vtkpythonrc.
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/vtkpythonrc")
endif ()
endif ()
# This is where we actually wrap the modules that have requested it.
......@@ -53,7 +70,11 @@ vtk_write_python_modules_header_for_wrapped_modules(
add_executable(vtkpython vtkPythonAppInit.cxx vtkpython.rc)
add_executable(vtkpython vtkPythonAppInit.cxx)
if (WIN32)
target_link_libraries(vtkpython vtkpythonrc)
endif ()
int dummy(int a)
return a;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment