mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-29 16:20:11 -04:00
CMake: Add #line directives to interrogate_preamble_python_native
This commit is contained in:
parent
cf59d3d983
commit
0e0b2186c7
@ -64,11 +64,24 @@ target_link_libraries(interrogate p3cppParser p3interrogatedb
|
|||||||
PKG::OPENSSL)
|
PKG::OPENSSL)
|
||||||
|
|
||||||
# Python preamble for interrogate_module
|
# Python preamble for interrogate_module
|
||||||
|
set(_preamble_files)
|
||||||
|
foreach(_file ${INTERROGATE_PREAMBLE_PYTHON_NATIVE})
|
||||||
|
# Resolve symlinks, use absolute path, and add a `#line 1 ...` directive
|
||||||
|
get_filename_component(_file "${_file}" REALPATH)
|
||||||
|
|
||||||
|
string(SHA1 _hash "${_file}")
|
||||||
|
set(_line_file "${CMAKE_CURRENT_BINARY_DIR}/.${_hash}.h")
|
||||||
|
file(WRITE "${_line_file}" "#line 1 \"${_file}\"\n")
|
||||||
|
|
||||||
|
list(APPEND _preamble_files "${_line_file}")
|
||||||
|
list(APPEND _preamble_files "${_file}")
|
||||||
|
endforeach(_file)
|
||||||
|
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/interrogate_preamble_python_native.cxx
|
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/interrogate_preamble_python_native.cxx
|
||||||
COMMAND ${CMAKE_COMMAND}
|
COMMAND ${CMAKE_COMMAND}
|
||||||
-D OUTPUT_FILE="${CMAKE_CURRENT_BINARY_DIR}/interrogate_preamble_python_native.cxx"
|
-D OUTPUT_FILE="${CMAKE_CURRENT_BINARY_DIR}/interrogate_preamble_python_native.cxx"
|
||||||
-D INPUT_FILES="${INTERROGATE_PREAMBLE_PYTHON_NATIVE}"
|
-D INPUT_FILES="${_preamble_files}"
|
||||||
-D SYMBOL_NAME="interrogate_preamble_python_native"
|
-D SYMBOL_NAME="interrogate_preamble_python_native"
|
||||||
-P ${PROJECT_SOURCE_DIR}/cmake/scripts/ConcatenateToCXX.cmake
|
-P ${PROJECT_SOURCE_DIR}/cmake/scripts/ConcatenateToCXX.cmake
|
||||||
DEPENDS ${INTERROGATE_PREAMBLE_PYTHON_NATIVE}
|
DEPENDS ${INTERROGATE_PREAMBLE_PYTHON_NATIVE}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user