X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=wrappers%2FCMakeLists.txt;h=cc817d51399f0262896b0ceac2ba2b5ef0721c9c;hb=e7cb2b98575d5ff3801bd3527a648e0dbfdebdad;hp=1fb87e39ec2e43afa56ae95f773fb290608eb974;hpb=7e351daaeb23a1fbc31b8af1a08d969676bfd704;p=apitrace diff --git a/wrappers/CMakeLists.txt b/wrappers/CMakeLists.txt index 1fb87e3..cc817d5 100644 --- a/wrappers/CMakeLists.txt +++ b/wrappers/CMakeLists.txt @@ -4,9 +4,19 @@ include_directories ( ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/helpers ${CMAKE_BINARY_DIR}/dispatch + ${CMAKE_SOURCE_DIR}/dispatch ) +add_library (common_trace STATIC + trace.cpp +) + +set_target_properties (common_trace PROPERTIES + # Ensure it can be statically linked in shared libraries + COMPILE_FLAGS "${CMAKE_SHARED_LIBRARY_CXX_FLAGS}" +) if (WIN32) if (MINGW) @@ -34,6 +44,7 @@ if (WIN32) ) add_library (ddrawtrace MODULE ddraw.def ddrawtrace.cpp) target_link_libraries (ddrawtrace + common_trace common ${ZLIB_LIBRARIES} ${SNAPPY_LIBRARIES} @@ -62,8 +73,9 @@ if (WIN32) ${CMAKE_SOURCE_DIR}/specs/winapi.py ${CMAKE_SOURCE_DIR}/specs/stdapi.py ) - add_library (d3d8trace MODULE d3d8.def d3d8trace.cpp d3dshader.cpp) + add_library (d3d8trace MODULE d3d8.def d3d8trace.cpp d3d9shader.cpp) target_link_libraries (d3d8trace + common_trace common ${ZLIB_LIBRARIES} ${SNAPPY_LIBRARIES} @@ -92,8 +104,9 @@ if (WIN32) ${CMAKE_SOURCE_DIR}/specs/winapi.py ${CMAKE_SOURCE_DIR}/specs/stdapi.py ) - add_library (d3d9trace MODULE d3d9.def d3d9trace.cpp d3dshader.cpp) + add_library (d3d9trace MODULE d3d9.def d3d9trace.cpp d3d9shader.cpp) target_link_libraries (d3d9trace + common_trace common ${ZLIB_LIBRARIES} ${SNAPPY_LIBRARIES} @@ -106,8 +119,8 @@ if (WIN32) endif () # d3d10.dll - if (DirectX_D3DX10_INCLUDE_DIR) - include_directories (SYSTEM ${DirectX_D3DX10_INCLUDE_DIR}) + if (DirectX_D3D10_INCLUDE_DIR) + include_directories (SYSTEM ${DirectX_D3D10_INCLUDE_DIR}) add_custom_command ( OUTPUT d3d10trace.cpp COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d10trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d10trace.cpp @@ -116,9 +129,11 @@ if (WIN32) 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/d3d10misc.py ${CMAKE_SOURCE_DIR}/specs/d3d10sdklayers.py + ${CMAKE_SOURCE_DIR}/specs/d3d10shader.py + ${CMAKE_SOURCE_DIR}/specs/d3d10effect.py ${CMAKE_SOURCE_DIR}/specs/d3dcommon.py ${CMAKE_SOURCE_DIR}/specs/dxgi.py ${CMAKE_SOURCE_DIR}/specs/dxgitype.py @@ -126,8 +141,9 @@ if (WIN32) ${CMAKE_SOURCE_DIR}/specs/winapi.py ${CMAKE_SOURCE_DIR}/specs/stdapi.py ) - add_library (d3d10trace MODULE d3d10.def d3d10trace.cpp) + add_library (d3d10trace MODULE d3d10.def d3d10trace.cpp d3d10shader.cpp) target_link_libraries (d3d10trace + common_trace common ${ZLIB_LIBRARIES} ${SNAPPY_LIBRARIES} @@ -140,7 +156,7 @@ if (WIN32) endif () # d3d10_1.dll - if (DirectX_D3DX10_INCLUDE_DIR AND DirectX_D3D10_1_INCLUDE_DIR) + if (DirectX_D3D10_1_INCLUDE_DIR) include_directories (SYSTEM ${DirectX_D3D10_1_INCLUDE_DIR}) add_custom_command ( OUTPUT d3d10_1trace.cpp @@ -162,6 +178,7 @@ if (WIN32) ) add_library (d3d10_1trace MODULE d3d10_1.def d3d10_1trace.cpp) target_link_libraries (d3d10_1trace + common_trace common ${ZLIB_LIBRARIES} ${SNAPPY_LIBRARIES} @@ -174,15 +191,22 @@ if (WIN32) endif () # d3d11.dll - if (DirectX_D3DX11_INCLUDE_DIR) - include_directories (SYSTEM ${DirectX_D3DX11_INCLUDE_DIR}) + if (DirectX_D3D11_INCLUDE_DIR) + if (DirectX_D3D11_1_INCLUDE_DIR) + set (HAVE_D3D11_1 1) + else () + set (HAVE_D3D11_1 0) + endif () + + include_directories (SYSTEM ${DirectX_D3D11_INCLUDE_DIR}) add_custom_command ( OUTPUT d3d11trace.cpp - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d11trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d11trace.cpp + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d11trace.py ${HAVE_D3D11_1} > ${CMAKE_CURRENT_BINARY_DIR}/d3d11trace.cpp DEPENDS d3d11trace.py dlltrace.py trace.py + ${CMAKE_SOURCE_DIR}/specs/d3d11_1.py ${CMAKE_SOURCE_DIR}/specs/d3d11.py ${CMAKE_SOURCE_DIR}/specs/d3d11sdklayers.py ${CMAKE_SOURCE_DIR}/specs/d3dcommon.py @@ -194,6 +218,7 @@ if (WIN32) ) add_library (d3d11trace MODULE d3d11.def d3d11trace.cpp) target_link_libraries (d3d11trace + common_trace common ${ZLIB_LIBRARIES} ${SNAPPY_LIBRARIES} @@ -205,6 +230,73 @@ if (WIN32) install (TARGETS d3d11trace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR}) endif () + # d2d1.dll, dwrite.dll + if (DirectX_D2D1_INCLUDE_DIR) + include_directories (SYSTEM ${DirectX_D2D1_INCLUDE_DIR}) + + add_custom_command ( + OUTPUT d2d1trace.cpp + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d2d1trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d2d1trace.cpp + DEPENDS + d2d1trace.py + trace.py + ${CMAKE_SOURCE_DIR}/specs/d2d1.py + ${CMAKE_SOURCE_DIR}/specs/d2d1.py + ${CMAKE_SOURCE_DIR}/specs/d2dbasetypes.py + ${CMAKE_SOURCE_DIR}/specs/d2derr.py + ${CMAKE_SOURCE_DIR}/specs/dwrite.py + ${CMAKE_SOURCE_DIR}/specs/dcommon.py + ${CMAKE_SOURCE_DIR}/specs/dxgi.py + ${CMAKE_SOURCE_DIR}/specs/dxgitype.py + ${CMAKE_SOURCE_DIR}/specs/dxgiformat.py + ${CMAKE_SOURCE_DIR}/specs/winapi.py + ${CMAKE_SOURCE_DIR}/specs/stdapi.py + ) + add_library (d2d1 MODULE d2d1.def d2d1trace.cpp) + target_link_libraries (d2d1 + common_trace + common + ${ZLIB_LIBRARIES} + ${SNAPPY_LIBRARIES} + ) + set_target_properties (d2d1 + PROPERTIES PREFIX "" + OUTPUT_NAME d2d1 + ) + install (TARGETS d2d1 LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR}) + + add_custom_command ( + OUTPUT dwritetrace.cpp + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/dwritetrace.py > ${CMAKE_CURRENT_BINARY_DIR}/dwritetrace.cpp + DEPENDS + dwritetrace.py + trace.py + ${CMAKE_SOURCE_DIR}/specs/d2d1.py + ${CMAKE_SOURCE_DIR}/specs/d2d1.py + ${CMAKE_SOURCE_DIR}/specs/d2dbasetypes.py + ${CMAKE_SOURCE_DIR}/specs/d2derr.py + ${CMAKE_SOURCE_DIR}/specs/dwrite.py + ${CMAKE_SOURCE_DIR}/specs/dcommon.py + ${CMAKE_SOURCE_DIR}/specs/dxgi.py + ${CMAKE_SOURCE_DIR}/specs/dxgitype.py + ${CMAKE_SOURCE_DIR}/specs/dxgiformat.py + ${CMAKE_SOURCE_DIR}/specs/winapi.py + ${CMAKE_SOURCE_DIR}/specs/stdapi.py + ) + add_library (dwrite MODULE dwrite.def dwritetrace.cpp) + target_link_libraries (dwrite + common_trace + common + ${ZLIB_LIBRARIES} + ${SNAPPY_LIBRARIES} + ) + set_target_properties (dwrite + PROPERTIES PREFIX "" + OUTPUT_NAME dwrite + ) + install (TARGETS dwrite LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR}) + endif (DirectX_D2D1_INCLUDE_DIR) + # opengl32.dll add_custom_command ( OUTPUT wgltrace.cpp @@ -225,10 +317,12 @@ if (WIN32) add_library (wgltrace MODULE opengl32.def wgltrace.cpp glcaps.cpp + gltrace_state.cpp ) add_dependencies (wgltrace glproc) target_link_libraries (wgltrace glproc_gl + common_trace common ${ZLIB_LIBRARIES} ${SNAPPY_LIBRARIES} @@ -258,6 +352,7 @@ elseif (APPLE) add_library (cgltrace SHARED cgltrace.cpp glcaps.cpp + gltrace_state.cpp ) add_dependencies (cgltrace glproc) @@ -271,6 +366,7 @@ elseif (APPLE) target_link_libraries (cgltrace glproc_gl + common_trace common ${ZLIB_LIBRARIES} ${SNAPPY_LIBRARIES} @@ -298,6 +394,7 @@ elseif (X11_FOUND) add_library (glxtrace SHARED glxtrace.cpp glcaps.cpp + gltrace_state.cpp ) add_dependencies (glxtrace glproc) @@ -312,6 +409,7 @@ elseif (X11_FOUND) target_link_libraries (glxtrace glproc_gl + common_trace common ${ZLIB_LIBRARIES} ${SNAPPY_LIBRARIES} @@ -344,6 +442,8 @@ if (ENABLE_EGL AND NOT WIN32 AND NOT APPLE) add_library (egltrace SHARED egltrace.cpp glcaps.cpp + gltrace_state.cpp + ${CMAKE_SOURCE_DIR}/helpers/eglsize.cpp ) add_dependencies (egltrace glproc) @@ -358,6 +458,7 @@ if (ENABLE_EGL AND NOT WIN32 AND NOT APPLE) target_link_libraries (egltrace glproc_egl + common_trace common ${ZLIB_LIBRARIES} ${SNAPPY_LIBRARIES}