CMakeLists.txt 1.94 KB
include(ExternalProject)

set(QBOX_CONFIGURE_COMMAND
    ${CMAKE_CURRENT_SOURCE_DIR}/configure
        --target-list=aarch64-softmmu
        --library
        --qbox
        --tlm2c-includedir="$<JOIN:$<TARGET_PROPERTY:Tlm2c::tlm2c,INTERFACE_INCLUDE_DIRECTORIES>, >"
        --tlm2c-libdir="$<TARGET_FILE_DIR:Tlm2c::tlm2c>"
        --prefix=${CMAKE_CURRENT_BINARY_DIR}/install
        --disable-pie
        --extra-cflags=-fPIC\ -fpic\ -ftls-model=global-dynamic
        --disable-debug-tcg
        --disable-sparse
        --disable-gtk
        --disable-vnc
        --disable-xen
        --disable-brlapi
        --disable-vnc-sasl
        --disable-vnc-jpeg
        --disable-vnc-png
        --disable-curses
        --disable-curl
        --disable-bluez
        --disable-slirp
        --disable-kvm
        --disable-user
        --disable-linux-user
        --disable-bsd-user
        --disable-pie
        --disable-linux-aio
        --disable-attr
        --disable-blobs
        --disable-docs
        --disable-vhost-net
        --disable-spice
        --disable-usb-redir
        --disable-guest-agent
        --disable-cap-ng
        --disable-libiscsi
        --disable-libusb
        --disable-tools
        --disable-nettle
        --disable-virglrenderer
        --disable-opengl
        --disable-vde
        --disable-vte
        --disable-rbd
        --disable-xfsctl
        --disable-smartcard
        --disable-libnfs
        --disable-snappy
        --disable-numa
        --audio-drv-list=
)

if(CMAKE_BUILD_TYPE STREQUAL "Debug")
    list(APPEND QBOX_CONFIGURE_COMMAND --enable-debug)
endif()

ExternalProject_Add(qbox
    SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}
    BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/build
    INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/install
    CONFIGURE_COMMAND ${QBOX_CONFIGURE_COMMAND}
    DEPENDS Tlm2c::tlm2c
    BUILD_COMMAND $(MAKE)
)

ExternalProject_Add_Step(qbox force-build
    DEPENDEES update
    DEPENDERS build
    ALWAYS 1
)