https://github.com/halide/Halide
Raw File
Tip revision: a12b3cb12e0d77279c6df68baaa0273ceca41664 authored by Andrew Adams on 15 October 2021, 20:00:33 UTC
Add comment elaborating on why this is a good idea
Tip revision: a12b3cb
AddHalideGeneratorPython.cmake
set(HALIDE_PYSTUB_CPP_PATH ${CMAKE_CURRENT_LIST_DIR}/PyStub.cpp)

function(add_generator_python TARGET)
    set(options)
    set(oneValueArgs)
    set(multiValueArgs)
    cmake_parse_arguments(args "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})

    Python3_add_library(${TARGET} MODULE ${HALIDE_PYSTUB_CPP_PATH} ${args_UNPARSED_ARGUMENTS})
    target_compile_definitions(${TARGET} PRIVATE
                               "HALIDE_PYSTUB_GENERATOR_NAME=${TARGET}"
                               "HALIDE_PYSTUB_MODULE_NAME=${TARGET}")
    target_link_libraries(${TARGET} PRIVATE Halide::PyStubs)
endfunction()
back to top