Commit 00144cb7 authored by Pauli Nieminen's avatar Pauli Nieminen Committed by Kenneth Graunke

make: Make util libraries shared in non-windows systems

Incremental builds take long time linking tests if utilities are
modified. The link time can be eliminate if libraries are made shared.

Shared libraries need to specify symbols that are excepted to be
declared in executeable as weak to allow linking without symbols that
aren't used in runtime.

Windows has limitation that shared library can't have programs main
function that forces windows to use static libraries.
Signed-off-by: default avatarPauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: default avatarChad Versace <chad.versace@linux.intel.com>
Acked-by: Kenneth Graunke's avatarKenneth Graunke <kenneth@whitecape.org>
parent 7788efd8
......@@ -75,7 +75,11 @@ endfunction(piglit_add_executable)
function(piglit_add_library name)
list(REMOVE_AT ARGV 0)
add_library(${name} ${ARGV})
if(WIN32)
add_library(${name} ${ARGV})
else(WIN32)
add_library(${name} SHARED ${ARGV})
endif(WIN32)
add_dependencies(${name} piglit_dispatch_gen)
endfunction(piglit_add_library)
......@@ -26,6 +26,7 @@ if(OPENGL_egl_LIBRARY)
${UTIL_SOURCES}
piglit-util-egl.c
)
link_libraries(${OPENGL_egl_LIBRARY})
endif(OPENGL_egl_LIBRARY)
if(USE_WAFFLE)
......
......@@ -46,6 +46,20 @@ unsigned piglit_winsys_fbo = 0;
static int piglit_window;
static enum piglit_result result;
#ifndef _WIN32
__attribute__((weak)) int piglit_width = 100;
__attribute__((weak)) int piglit_height = 100;
__attribute__((weak)) int piglit_window_mode = GLUT_RGB | GLUT_DOUBLE;
__attribute__((weak)) enum piglit_result piglit_display(void)
{
return PIGLIT_FAIL;
}
__attribute__((weak)) void piglit_init(int argc, char **argv)
{
}
#endif
static void
display(void)
{
......
......@@ -34,6 +34,11 @@
int piglit_automatic;
#ifndef _WIN32
__attribute__((weak)) int piglit_width = 100;
__attribute__((weak)) int piglit_height = 100;
#endif
Display *
piglit_get_glx_display()
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment