Skip to content

sonic is not optional with cmake build system #2273

@mweinelt

Description

@mweinelt

Since c60a49d the logic for sonic is as follows:

if (SONIC_LIB AND SONIC_INC)
set(HAVE_LIBSONIC ON)
else()
FetchContent_Declare(sonic-git
GIT_REPOSITORY https://github.com/waywardgeek/sonic.git
GIT_TAG fbf75c3d6d846bad3bb3d456cbc5d07d9fd8c104
)
FetchContent_MakeAvailable(sonic-git)
FetchContent_GetProperties(sonic-git)
add_library(sonic OBJECT ${sonic-git_SOURCE_DIR}/sonic.c)
# enable PIC in order to embed libsonic.a in a .so
set_property(TARGET sonic PROPERTY POSITION_INDEPENDENT_CODE ON)
target_include_directories(sonic PUBLIC ${sonic-git_SOURCE_DIR})
set(HAVE_LIBSONIC ON)
set(SONIC_LIB sonic)
set(SONIC_INC ${sonic-git_SOURCE_DIR})
endif()

That means if we don't provide a libsonic then cmake will try to clone their git repo and include it in the build process.

The dependencies listed in the building guide also imply that it should be optional, although it mostly seems to document the autoconf build system.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions