CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
102 lines
3.7 KiB
CMake
102 lines
3.7 KiB
CMake
set(derived_headers_location "${CMAKE_CURRENT_BINARY_DIR}/DerivedHeaders")
|
|
|
|
# Obtain the original headers from their staged location in the build directory.
|
|
set(original_headers_location "${CMAKE_BINARY_DIR}/include/lldb")
|
|
set(headers_to_process
|
|
SBDefines.h
|
|
lldb-defines.h
|
|
lldb-enumerations.h
|
|
lldb-types.h
|
|
)
|
|
|
|
file(MAKE_DIRECTORY ${derived_headers_location})
|
|
|
|
# Take the original headers and convert them RPC as necessary using the conversion script.
|
|
set(original_headers)
|
|
set(derived_headers)
|
|
foreach(header ${headers_to_process})
|
|
set(original_header "${original_headers_location}/${header}")
|
|
|
|
get_filename_component(header_filename ${header} NAME)
|
|
string(REPLACE "lldb-" "lldb-rpc-" rpc_header_filename "${header_filename}")
|
|
set(derived_header "${derived_headers_location}/${rpc_header_filename}")
|
|
|
|
list(APPEND original_headers "${original_header}")
|
|
list(APPEND derived_headers "${derived_header}")
|
|
add_custom_command(OUTPUT ${derived_header}
|
|
COMMAND ${Python3_EXECUTABLE} ${LLDB_SOURCE_DIR}/scripts/convert-lldb-header-to-rpc-header.py
|
|
${original_header} ${derived_header}
|
|
DEPENDS ${original_header}
|
|
|
|
COMMENT "Creating ${derived_header}"
|
|
)
|
|
endforeach()
|
|
|
|
# Do the same thing for any header files that were autogenerated.
|
|
set(generated_headers_to_process
|
|
API/SBLanguages.h
|
|
)
|
|
foreach(header ${generated_headers_to_process})
|
|
set(original_header "${LLDB_OBJ_DIR}/include/lldb/${header}")
|
|
|
|
get_filename_component(header_filename ${header} NAME)
|
|
string(REPLACE "lldb-" "lldb-rpc-" rpc_header_filename "${header_filename}")
|
|
set(derived_header "${derived_headers_location}/${rpc_header_filename}")
|
|
|
|
list(APPEND original_headers "${original_header}")
|
|
list(APPEND derived_headers "${derived_header}")
|
|
add_custom_command(OUTPUT ${derived_header}
|
|
COMMAND ${CMAKE_COMMAND} -E copy ${original_header} ${derived_header}
|
|
COMMAND ${Python3_EXECUTABLE} ${LLDB_SOURCE_DIR}/scripts/convert-lldb-header-to-rpc-header.py
|
|
${original_header} ${derived_header}
|
|
DEPENDS lldb-sbapi-dwarf-enums
|
|
|
|
COMMENT "Creating ${derived_header}"
|
|
)
|
|
endforeach()
|
|
|
|
add_custom_target(copy-aux-rpc-headers DEPENDS ${derived_headers})
|
|
add_dependencies(copy-aux-rpc-headers liblldb-header-staging)
|
|
|
|
list(APPEND public_headers
|
|
${derived_headers_location}/SBDefines.h
|
|
${derived_headers_location}/SBLanguages.h
|
|
${derived_headers_location}/lldb-rpc-enumerations.h
|
|
${derived_headers_location}/lldb-rpc-types.h
|
|
${derived_headers_location}/lldb-rpc-defines.h
|
|
)
|
|
|
|
# Collect and preprocess headers for the framework bundle
|
|
set(version_header
|
|
${derived_headers_location}/lldb-rpc-defines.h
|
|
)
|
|
|
|
function(FixIncludePaths in subfolder out)
|
|
get_filename_component(base_name ${in} NAME)
|
|
set(parked_header ${CMAKE_CURRENT_BINARY_DIR}/ParkedHeaders/${subfolder}/${base_name})
|
|
set(${out} ${parked_header} PARENT_SCOPE)
|
|
find_program(unifdef_EXECUTABLE unifdef)
|
|
|
|
add_custom_command(OUTPUT ${parked_header}
|
|
COMMAND ${LLDB_SOURCE_DIR}/scripts/framework-header-fix.py
|
|
-f lldb_rpc -i ${in} -o ${parked_header} -p ${unifdef_EXECUTABLE} --unifdef_guards SWIG
|
|
DEPENDS ${in}
|
|
COMMENT "Fixing includes in ${in}"
|
|
)
|
|
endfunction()
|
|
|
|
set(preprocessed_headers)
|
|
|
|
# Apply include-paths fix and any version fix on all headers and park them.
|
|
foreach(source_header ${public_headers})
|
|
FixIncludePaths(${source_header} Headers parked_header)
|
|
list(APPEND preprocessed_headers ${parked_header})
|
|
endforeach()
|
|
|
|
# Wrap header preprocessing in a target, so liblldbrpc can depend on.
|
|
add_custom_target(liblldbrpc-headers DEPENDS ${preprocessed_headers})
|
|
add_dependencies(liblldbrpc-headers copy-aux-rpc-headers liblldb-header-staging)
|
|
set_target_properties(liblldbrpc-headers PROPERTIES
|
|
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ParkedHeaders
|
|
)
|