aboutsummaryrefslogtreecommitdiffstats
path: root/build/export_generators/hardcoded-cmake/cmake/archive.cmake
blob: 0f4f0b4d359436ee21e2f9883a45f73ad0dd0cd6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
find_package(Python3 REQUIRED)

function(target_rodata_sources TgtName Scope)
  foreach(rodata ${ARGN})
    get_filename_component(CppVar ${rodata} NAME_WLE)
    add_custom_command(
        OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${CppVar}.cpp
        COMMAND Python3::Interpreter ${PROJECT_SOURCE_DIR}/build/scripts/rodata2cpp.py ${CppVar} ${rodata} ${CMAKE_CURRENT_BINARY_DIR}/${CppVar}.cpp
        DEPENDS ${PROJECT_SOURCE_DIR}/build/scripts/rodata2cpp.py ${rodata}
    )
    target_sources(${TgtName} ${Scope} ${CMAKE_CURRENT_BINARY_DIR}/${CppVar}.cpp)
  endforeach()
endfunction()