CMakeLists.txt 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. project(libobs-d3d11)
  2. add_library(libobs-d3d11 MODULE)
  3. add_library(OBS::libobs-d3d11 ALIAS libobs-d3d11)
  4. target_sources(
  5. libobs-d3d11
  6. PRIVATE d3d11-indexbuffer.cpp
  7. d3d11-samplerstate.cpp
  8. d3d11-shader.cpp
  9. d3d11-shaderprocessor.cpp
  10. d3d11-shaderprocessor.hpp
  11. d3d11-stagesurf.cpp
  12. d3d11-subsystem.cpp
  13. d3d11-subsystem.hpp
  14. d3d11-texture2d.cpp
  15. d3d11-texture3d.cpp
  16. d3d11-vertexbuffer.cpp
  17. d3d11-duplicator.cpp
  18. d3d11-rebuild.cpp
  19. d3d11-zstencilbuffer.cpp)
  20. set(MODULE_DESCRIPTION "OBS Library D3D11 wrapper")
  21. configure_file(${CMAKE_SOURCE_DIR}/cmake/bundle/windows/obs-module.rc.in
  22. libobs-d3d11.rc)
  23. target_include_directories(libobs-d3d11 PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
  24. target_sources(libobs-d3d11 PRIVATE libobs-d3d11.rc)
  25. target_compile_features(libobs-d3d11 PRIVATE cxx_std_17)
  26. target_compile_definitions(
  27. libobs-d3d11 PRIVATE UNICODE _UNICODE _CRT_SECURE_NO_WARNINGS
  28. _CRT_NONSTDC_NO_WARNINGS)
  29. if(NOT DEFINED GPU_PRIORITY_VAL
  30. OR "x${GPU_PRIORITY_VAL}x" STREQUAL "xx"
  31. OR "${GPU_PRIORITY_VAL}" STREQUAL "0")
  32. target_compile_definitions(libobs-d3d11 PRIVATE USE_GPU_PRIORITY=FALSE
  33. GPU_PRIORITY_VAL=0)
  34. else()
  35. target_compile_definitions(
  36. libobs-d3d11 PRIVATE USE_GPU_PRIORITY=TRUE
  37. GPU_PRIORITY_VAL=${GPU_PRIORITY_VAL})
  38. endif()
  39. target_link_libraries(libobs-d3d11 PRIVATE OBS::libobs d3d9 d3d11 dxgi)
  40. set_target_properties(
  41. libobs-d3d11
  42. PROPERTIES OUTPUT_NAME libobs-d3d11
  43. FOLDER "core"
  44. PREFIX "")
  45. setup_binary_target(libobs-d3d11)