Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Move dispatch to its own subdirectory.

  • Loading branch information...
commit 4f242f43bf4b3c8f5daadc4496c0e84ae55117b3 1 parent b2f9ad1
@jrfonseca jrfonseca authored
View
1  .gitignore
@@ -32,7 +32,6 @@ apitrace
build
dxsdk
eglretrace
-glproc.hpp
glretrace
install_manifest.txt
qapitrace
View
19 CMakeLists.txt
@@ -237,17 +237,6 @@ include_directories (
${CMAKE_CURRENT_SOURCE_DIR}/common
)
-add_custom_command (
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/glproc.hpp
- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/glproc.py > ${CMAKE_CURRENT_BINARY_DIR}/glproc.hpp
- DEPENDS glproc.py dispatch.py specs/wglapi.py specs/glxapi.py specs/cglapi.py specs/eglapi.py specs/glesapi.py specs/glapi.py specs/gltypes.py specs/stdapi.py
-)
-
-# Wrap glproc.hpp as a target to prevent the command from being executed
-# multiple times simulatenously, when the targets that depend on it are built
-# in parallel.
-add_custom_target (glproc DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/glproc.hpp)
-
if (WIN32)
set (os os_win32.cpp)
set (glws_os glws_wgl.cpp)
@@ -296,14 +285,10 @@ endif ()
##############################################################################
-# API tracers
+# Sub-directories
+add_subdirectory (dispatch)
add_subdirectory (wrappers)
-
-
-##############################################################################
-# API retracers
-
add_subdirectory (retrace)
View
1  dispatch/.gitignore
@@ -0,0 +1 @@
+glproc.hpp
View
55 dispatch/CMakeLists.txt
@@ -0,0 +1,55 @@
+##############################################################################
+# Dispatch
+
+include_directories (
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}
+)
+
+add_custom_command (
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/glproc.hpp
+ COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/glproc.py > ${CMAKE_CURRENT_BINARY_DIR}/glproc.hpp
+ DEPENDS
+ glproc.py
+ dispatch.py
+ ${CMAKE_SOURCE_DIR}/specs/wglapi.py
+ ${CMAKE_SOURCE_DIR}/specs/glxapi.py
+ ${CMAKE_SOURCE_DIR}/specs/cglapi.py
+ ${CMAKE_SOURCE_DIR}/specs/eglapi.py
+ ${CMAKE_SOURCE_DIR}/specs/glesapi.py
+ ${CMAKE_SOURCE_DIR}/specs/glapi.py
+ ${CMAKE_SOURCE_DIR}/specs/gltypes.py
+ ${CMAKE_SOURCE_DIR}/specs/stdapi.py
+)
+
+
+# Wrap glproc.hpp as a target to prevent the command from being executed
+# multiple times simulatenously, when the targets that depend on it are built
+# in parallel.
+add_custom_target (glproc DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/glproc.hpp)
+
+
+add_library (glproc_gl STATIC EXCLUDE_FROM_ALL
+ glproc_gl.cpp
+)
+
+add_dependencies (glproc_gl glproc)
+
+set_target_properties (glproc_gl PROPERTIES
+ # Ensure it can be statically linked in shared libraries
+ COMPILE_FLAGS "${CMAKE_SHARED_LIBRARY_CXX_FLAGS}"
+)
+
+if (ENABLE_EGL)
+ add_library (glproc_egl STATIC EXCLUDE_FROM_ALL
+ glproc_egl.cpp
+ )
+
+ add_dependencies (glproc_egl glproc)
+
+ set_target_properties (glproc_egl PROPERTIES
+ # Ensure it can be statically linked in shared libraries
+ COMPILE_FLAGS "${CMAKE_SHARED_LIBRARY_CXX_FLAGS}"
+ )
+endif ()
+
View
1  dispatch/__init__.py
@@ -0,0 +1 @@
+from dispatch import *
View
6 dispatch.py → dispatch/dispatch.py
@@ -28,6 +28,12 @@
"""
+# Adjust path
+import os.path
+import sys
+sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
+
+
import specs.stdapi as stdapi
View
2  glproc.py → dispatch/glproc.py
@@ -29,8 +29,8 @@
"""
-import specs.stdapi as stdapi
from dispatch import Dispatcher
+import specs.stdapi as stdapi
from specs.glapi import glapi
from specs.glxapi import glxapi
from specs.wglapi import wglapi
View
0  glproc_egl.cpp → dispatch/glproc_egl.cpp
File renamed without changes
View
0  glproc_gl.cpp → dispatch/glproc_gl.cpp
File renamed without changes
View
11 retrace/CMakeLists.txt
@@ -1,7 +1,10 @@
##############################################################################
# API retracers
-include_directories (${CMAKE_CURRENT_SOURCE_DIR})
+include_directories (
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_BINARY_DIR}/dispatch
+)
add_definitions (-DRETRACE)
@@ -47,13 +50,13 @@ add_dependencies (retrace_common glproc)
if (WIN32 OR APPLE OR X11_FOUND)
add_executable (glretrace
${glws_os}
- ${CMAKE_SOURCE_DIR}/glproc_gl.cpp
)
add_dependencies (glretrace glproc)
target_link_libraries (glretrace
retrace_common
+ glproc_gl
common
${PNG_LIBRARIES}
${ZLIB_LIBRARIES}
@@ -92,13 +95,13 @@ endif ()
if (ENABLE_EGL AND X11_FOUND AND NOT WIN32 AND NOT APPLE)
add_executable (eglretrace
glws_egl_xlib.cpp
- ${CMAKE_SOURCE_DIR}/glproc_egl.cpp
)
add_dependencies (eglretrace glproc)
target_link_libraries (eglretrace
retrace_common
+ glproc_egl
common
${PNG_LIBRARIES}
${ZLIB_LIBRARIES}
@@ -121,7 +124,9 @@ if (WIN32 AND DirectX_D3DX9_INCLUDE_DIR)
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3dretrace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3dretrace_d3d9.cpp
DEPENDS
d3dretrace.py
+ dllretrace.py
retrace.py
+ ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
${CMAKE_SOURCE_DIR}/specs/d3d9.py
${CMAKE_SOURCE_DIR}/specs/d3d9types.py
${CMAKE_SOURCE_DIR}/specs/d3d9caps.py
View
25 wrappers/CMakeLists.txt
@@ -2,7 +2,10 @@
# API tracers
-include_directories (${CMAKE_CURRENT_SOURCE_DIR})
+include_directories (
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_BINARY_DIR}/dispatch
+)
if (WIN32)
@@ -19,7 +22,9 @@ if (WIN32)
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/ddrawtrace.py > ${CMAKE_CURRENT_BINARY_DIR}/ddrawtrace.cpp
DEPENDS
ddrawtrace.py
+ dlltrace.py
trace.py
+ ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
${CMAKE_SOURCE_DIR}/specs/d3d.py
${CMAKE_SOURCE_DIR}/specs/d3dtypes.py
${CMAKE_SOURCE_DIR}/specs/d3dcaps.py
@@ -47,7 +52,9 @@ if (WIN32)
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d8trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d8trace.cpp
DEPENDS
d3d8trace.py
+ dlltrace.py
trace.py
+ ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
${CMAKE_SOURCE_DIR}/specs/d3d8.py
${CMAKE_SOURCE_DIR}/specs/d3d8types.py
${CMAKE_SOURCE_DIR}/specs/d3d8caps.py
@@ -74,7 +81,9 @@ if (WIN32)
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d9trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d9trace.cpp
DEPENDS
d3d9trace.py
+ dlltrace.py
trace.py
+ ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
${CMAKE_SOURCE_DIR}/specs/d3d9.py
${CMAKE_SOURCE_DIR}/specs/d3d9types.py
${CMAKE_SOURCE_DIR}/specs/d3d9caps.py
@@ -101,7 +110,9 @@ if (WIN32)
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d10trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d10trace.cpp
DEPENDS
d3d10trace.py
+ dlltrace.py
trace.py
+ ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
${CMAKE_SOURCE_DIR}/specs/d3d10misc.py
${CMAKE_SOURCE_DIR}/specs/d3d10.py
${CMAKE_SOURCE_DIR}/specs/d3d10sdklayers.py
@@ -132,7 +143,9 @@ if (WIN32)
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d10_1trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d10_1trace.cpp
DEPENDS
d3d10_1trace.py
+ dlltrace.py
trace.py
+ ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
${CMAKE_SOURCE_DIR}/specs/d3d10_1.py
${CMAKE_SOURCE_DIR}/specs/d3d10.py
${CMAKE_SOURCE_DIR}/specs/d3d10sdklayers.py
@@ -163,6 +176,7 @@ if (WIN32)
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d11trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d11trace.cpp
DEPENDS
d3d11trace.py
+ dlltrace.py
trace.py
${CMAKE_SOURCE_DIR}/specs/d3d11.py
${CMAKE_SOURCE_DIR}/specs/d3d11sdklayers.py
@@ -193,6 +207,7 @@ if (WIN32)
wgltrace.py
gltrace.py
trace.py
+ ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
${CMAKE_SOURCE_DIR}/specs/wglapi.py
${CMAKE_SOURCE_DIR}/specs/wglenum.py
${CMAKE_SOURCE_DIR}/specs/glapi.py
@@ -204,10 +219,10 @@ if (WIN32)
add_library (wgltrace MODULE opengl32.def
wgltrace.cpp
glcaps.cpp
- ${CMAKE_SOURCE_DIR}/glproc_gl.cpp
)
add_dependencies (wgltrace glproc)
target_link_libraries (wgltrace
+ glproc_gl
common
${ZLIB_LIBRARIES}
${SNAPPY_LIBRARIES}
@@ -237,7 +252,6 @@ elseif (APPLE)
add_library (cgltrace SHARED
cgltrace.cpp
glcaps.cpp
- ${CMAKE_SOURCE_DIR}/glproc_gl.cpp
)
add_dependencies (cgltrace glproc)
@@ -250,6 +264,7 @@ elseif (APPLE)
)
target_link_libraries (cgltrace
+ glproc_gl
common
${ZLIB_LIBRARIES}
${SNAPPY_LIBRARIES}
@@ -277,7 +292,6 @@ elseif (X11_FOUND)
add_library (glxtrace SHARED
glxtrace.cpp
glcaps.cpp
- ${CMAKE_SOURCE_DIR}/glproc_gl.cpp
)
add_dependencies (glxtrace glproc)
@@ -291,6 +305,7 @@ elseif (X11_FOUND)
)
target_link_libraries (glxtrace
+ glproc_gl
common
${ZLIB_LIBRARIES}
${SNAPPY_LIBRARIES}
@@ -323,7 +338,6 @@ if (ENABLE_EGL AND NOT WIN32 AND NOT APPLE)
add_library (egltrace SHARED
egltrace.cpp
glcaps.cpp
- ${CMAKE_SOURCE_DIR}/glproc_egl.cpp
)
add_dependencies (egltrace glproc)
@@ -337,6 +351,7 @@ if (ENABLE_EGL AND NOT WIN32 AND NOT APPLE)
)
target_link_libraries (egltrace
+ glproc_egl
common
${ZLIB_LIBRARIES}
${SNAPPY_LIBRARIES}
Please sign in to comment.
Something went wrong with that request. Please try again.