]> git.cworth.org Git - apitrace/blob - dispatch/CMakeLists.txt
stash: Trace and replay of glx-tfp works
[apitrace] / dispatch / CMakeLists.txt
1 ##############################################################################
2 # Dispatch
3
4 include_directories (
5     ${CMAKE_CURRENT_BINARY_DIR}
6     ${CMAKE_CURRENT_SOURCE_DIR}
7 )
8
9 add_custom_command (
10     OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/glproc.hpp
11     COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/glproc.py > ${CMAKE_CURRENT_BINARY_DIR}/glproc.hpp
12     DEPENDS
13         glproc.py
14         dispatch.py
15         ${CMAKE_SOURCE_DIR}/specs/wglapi.py
16         ${CMAKE_SOURCE_DIR}/specs/glxapi.py
17         ${CMAKE_SOURCE_DIR}/specs/cglapi.py
18         ${CMAKE_SOURCE_DIR}/specs/eglapi.py
19         ${CMAKE_SOURCE_DIR}/specs/glesapi.py
20         ${CMAKE_SOURCE_DIR}/specs/glapi.py
21         ${CMAKE_SOURCE_DIR}/specs/gltypes.py
22         ${CMAKE_SOURCE_DIR}/specs/stdapi.py
23         ${CMAKE_SOURCE_DIR}/specs/xapi.py
24 )
25
26
27 # Wrap glproc.hpp as a target to prevent the command from being executed
28 # multiple times simulatenously, when the targets that depend on it are built
29 # in parallel.
30 add_custom_target (glproc DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/glproc.hpp)
31
32
33 add_library (glproc_gl STATIC EXCLUDE_FROM_ALL
34     glproc_gl.cpp
35 )
36
37 add_dependencies (glproc_gl glproc)
38
39 set_target_properties (glproc_gl PROPERTIES
40     # Ensure it can be statically linked in shared libraries
41     COMPILE_FLAGS "${CMAKE_SHARED_LIBRARY_CXX_FLAGS}"
42 )
43
44 if (ENABLE_EGL)
45     add_library (glproc_egl STATIC EXCLUDE_FROM_ALL
46         glproc_egl.cpp
47     )
48
49     add_dependencies (glproc_egl glproc)
50
51     set_target_properties (glproc_egl PROPERTIES
52         # Ensure it can be statically linked in shared libraries
53         COMPILE_FLAGS "${CMAKE_SHARED_LIBRARY_CXX_FLAGS}"
54     )
55 endif ()
56