Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

CMakeLists.txt 2.0KB

il y a 6 mois
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. # MIT License
  2. #
  3. # Copyright (c) 2016-2022 The ZLMediaKit project authors. All Rights Reserved.
  4. #
  5. # Permission is hereby granted, free of charge, to any person obtaining a copy
  6. # of this software and associated documentation files (the "Software"), to deal
  7. # in the Software without restriction, including without limitation the rights
  8. # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9. # copies of the Software, and to permit persons to whom the Software is
  10. # furnished to do so, subject to the following conditions:
  11. #
  12. # The above copyright notice and this permission notice shall be included in all
  13. # copies or substantial portions of the Software.
  14. #
  15. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18. # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19. # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20. # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  21. # SOFTWARE.
  22. #
  23. aux_source_directory(. TEST_SRC_LIST)
  24. foreach(TEST_SRC ${TEST_SRC_LIST})
  25. get_filename_component(TEST_EXE_NAME ${TEST_SRC} NAME_WE)
  26. if(NOT TARGET ZLMediaKit::WebRTC)
  27. # 暂时过滤掉依赖 WebRTC 的测试模块
  28. if("${TEST_EXE_NAME}" MATCHES "test_rtcp_nack")
  29. continue()
  30. endif()
  31. endif()
  32. message(STATUS "add test: ${TEST_EXE_NAME}")
  33. add_executable(${TEST_EXE_NAME} ${TEST_SRC})
  34. target_compile_options(${TEST_EXE_NAME}
  35. PRIVATE ${COMPILE_OPTIONS_DEFAULT})
  36. target_compile_definitions(${TEST_EXE_NAME}
  37. PRIVATE ${MK_COMPILE_DEFINITIONS})
  38. if(USE_SOLUTION_FOLDERS)
  39. SET_PROPERTY(TARGET ${TEST_EXE_NAME} PROPERTY FOLDER "test")
  40. endif()
  41. if(CMAKE_SYSTEM_NAME MATCHES "Linux")
  42. target_link_libraries(${TEST_EXE_NAME} -Wl,--start-group ${MK_LINK_LIBRARIES} -Wl,--end-group)
  43. else()
  44. target_link_libraries(${TEST_EXE_NAME} ${MK_LINK_LIBRARIES})
  45. endif()
  46. endforeach()