CMakeLists.txt 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # Copyright (C) Microsoft Corporation. All rights reserved.
  2. # This file is distributed under the University of Illinois Open Source License. See LICENSE.TXT for details.
  3. # Generate ETW instrumentation.
  4. # Create the header in a temporary file and only update when necessary,
  5. # to avoid invalidating targets that depend on it.
  6. add_custom_command(
  7. OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/dxc/Tracing/tmpdxcetw.h
  8. COMMAND mc -r ${CMAKE_CURRENT_BINARY_DIR} -h ${CMAKE_CURRENT_BINARY_DIR} -p DxcEtw_ -um -z tmpdxcetw ${CMAKE_CURRENT_SOURCE_DIR}/dxcetw.man
  9. DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/dxcetw.man
  10. COMMENT "Building instrumentation manifest ..."
  11. )
  12. add_custom_command(
  13. OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/dxc/Tracing/dxcetw.h
  14. COMMAND ${CMAKE_COMMAND} -E copy_if_different
  15. ${CMAKE_CURRENT_BINARY_DIR}/tmpdxcetw.h
  16. ${CMAKE_CURRENT_BINARY_DIR}/dxcetw.h
  17. COMMAND ${CMAKE_COMMAND} -E copy_if_different
  18. ${CMAKE_CURRENT_BINARY_DIR}/tmpdxcetw.rc
  19. ${CMAKE_CURRENT_BINARY_DIR}/dxcetw.rc
  20. COMMAND ${CMAKE_COMMAND} -E copy_if_different
  21. ${CMAKE_CURRENT_BINARY_DIR}/tmpdxcetwTEMP.bin
  22. ${CMAKE_CURRENT_BINARY_DIR}/dxcetwTEMP.bin
  23. COMMAND ${CMAKE_COMMAND} -E copy_if_different
  24. ${CMAKE_CURRENT_BINARY_DIR}/tmpdxcetw_MSG00001.bin
  25. ${CMAKE_CURRENT_BINARY_DIR}/MSG00001.bin
  26. DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/dxc/Tracing/tmpdxcetw.h
  27. COMMENT "Updating instrumentation manifest ..."
  28. )
  29. set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/dxcetw.h PROPERTIES GENERATED 1)
  30. set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/dxcetw.rc PROPERTIES GENERATED 1)
  31. set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/dxcetwTEMP.bin PROPERTIES GENERATED 1)
  32. set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/MSG00001.bin PROPERTIES GENERATED 1)
  33. add_custom_target(DxcEtw
  34. DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/dxc/Tracing/dxcetw.h
  35. SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/dxcetw.man
  36. )
  37. # Not quite tablegen, but close enough.
  38. set_target_properties(DxcEtw PROPERTIES FOLDER "Tablegenning")