Skip to content

Commit

Permalink
feature: generating miral and miroil symbols using a new script
Browse files Browse the repository at this point in the history
  • Loading branch information
mattkae committed Apr 23, 2024
1 parent f629688 commit 459f8bb
Show file tree
Hide file tree
Showing 11 changed files with 646 additions and 544 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/symbols-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Symbols Check

on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, ready_for_review]

concurrency:
group: ${{ github.workflow }}-${{ github.event.number && format('pr{0}', github.event.number) || github.ref_name }}
cancel-in-progress: true

jobs:
Run:
runs-on: ubuntu-latest

timeout-minutes: 10
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Install dependencies
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
sudo add-apt-repository --update "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy main"
sudo apt install libclang1-19
sudo apt install python3-clang-19
echo "MIR_SYMBOLS_MAP_GENERATOR_CLANG_SO_PATH=/usr/lib/llvm-19/lib/libclang-19.so.1" >> $GITHUB_ENV
echo "MIR_SYMBOLS_MAP_GENERATOR_CLANG_LIBRARY_PATH=/usr/lib/llvm-19/lib" >> $GITHUB_ENV
sudo apt-get build-dep ./
- name: Configure
run: >
cmake -B build ${{ github.workspace }}
- name: Check symbols
run: |
RET=0
cmake --build build --target check-miral-symbols-map || RET=$?
cmake --build build --target check-miroil-symbols-map || RET=$?
exit $RET
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ cmake-*
build
benchmarks/build

tools/bot-data.tar.xz
tools/bot-data.tar.xz
2 changes: 1 addition & 1 deletion doc/sphinx/.sphinx/build_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def DeduplicateExtensions(extensionNames: [str]):
requirements = [
"furo",
"pyspelling",
"sphinx==7.2.6",
"sphinx",
"sphinx-autobuild",
"sphinx-copybutton",
"sphinx-design",
Expand Down
27 changes: 21 additions & 6 deletions src/miral/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,27 @@ add_custom_target(regenerate-miral-debian-symbols ${MIR_CHECK_MIRAL_SYMBOLS_DEFA
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
VERBATIM)

add_custom_target(
generate-miral-symbols-map
COMMAND ${PROJECT_SOURCE_DIR}/tools/symbols_map_generator/main.py
--library-name miral
--version ${MIRAL_VERSION}
--symbols-map-path="${CMAKE_CURRENT_SOURCE_DIR}/symbols.map"
--external-headers-directory="${PROJECT_SOURCE_DIR}/include/miral"
--include-dirs "$<JOIN:$<TARGET_PROPERTY:miral,INCLUDE_DIRECTORIES>,:>"
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}")

add_custom_target(
check-miral-symbols-map
COMMAND ${PROJECT_SOURCE_DIR}/tools/symbols_map_generator/main.py
--library-name miral
--version ${MIRAL_VERSION}
--symbols-map-path="${CMAKE_CURRENT_SOURCE_DIR}/symbols.map"
--external-headers-directory="${PROJECT_SOURCE_DIR}/include/miral"
--include-dirs "$<JOIN:$<TARGET_PROPERTY:miral,INCLUDE_DIRECTORIES>,:>"
--diff
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}")

configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/miral.pc.in
${CMAKE_CURRENT_BINARY_DIR}/miral.pc
Expand All @@ -153,12 +174,6 @@ configure_file(
${miral_include}/miral/version.h
)

if(TARGET doc)
add_custom_target(regenerate-miral-symbols-map
${CMAKE_CURRENT_SOURCE_DIR}/regenerate-miral-symbols-map.py ${CMAKE_BINARY_DIR}/doc/sphinx/xml/*.xml > ${symbol_map}
DEPENDS doc)
endif()

install(TARGETS miral LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")
install(DIRECTORY ${CMAKE_SOURCE_DIR}/include/miral DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/miral.pc DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
235 changes: 0 additions & 235 deletions src/miral/regenerate-miral-symbols-map.py

This file was deleted.

Loading

0 comments on commit 459f8bb

Please sign in to comment.