# ----------------------------------------------------------------------------
# Target: waffle (shared library)
# ----------------------------------------------------------------------------

set(waffle_sources
    api/waffle_attrib_list.c
    core/wcore_error.c
    )

if(waffle_has_egl)
    list(APPEND waffle_sources
        egl/egl_choose_config.c
        egl/egl_no_native.c
        )
endif(waffle_has_egl)

if(waffle_has_x11)
    list(APPEND waffle_sources
        x11/x11.c
        )
endif(waffle_has_x11)

add_library(waffle SHARED ${waffle_sources})

if(waffle_has_x11_egl)
    target_link_libraries(waffle
        ${waffle_EGL_library}
        ${waffle_X11-xcb_library}
        )
endif(waffle_has_x11_egl)

# The version scheme for libwaffle.so follows the libtool guidelines
# (http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html).
set_target_properties(waffle
    PROPERTIES
    LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
    SOVERSION 0.0.0)

# ----------------------------------------------------------------------------
# Target: waffle (shared library)
# ----------------------------------------------------------------------------

set(waffle_sources
    api/waffle_attrib_list.c
    core/wcore_error.c
    )

if(waffle_has_egl)
    list(APPEND waffle_sources
        egl/egl_choose_config.c
        egl/egl_no_native.c
        )
endif(waffle_has_egl)

if(waffle_has_x11)
    list(APPEND waffle_sources
        x11/x11.c
        )
endif(waffle_has_x11)

add_library(waffle SHARED ${waffle_sources})

if(waffle_has_egl)
  target_link_libraries(waffle ${waffle_EGL_library})
endif(waffle_has_egl)

if(waffle_has_x11_egl)
  target_link_libraries(waffle ${waffle_X11-xcb_library})
endif(waffle_has_x11_egl)

# The version scheme for libwaffle.so follows the libtool guidelines
# (http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html).
set_target_properties(waffle
    PROPERTIES
    LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
    SOVERSION 0.0.0)

Refactor libraries linked to libwaffle
cmake: Refactor libraries linked to libwaffle

Separate linking of libEGL and libX11-xcb.

Signed-off-by: Chad Versace <a557f7f75bf28dc19ac99107f5cc7cd6b3fbdb1a@linux.intel.com>
