GTestConfig.cmake 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. ########################################################################
  2. # Experimental CMake build script for Google Test.
  3. #
  4. # Consider this a prototype. It will change drastically. For now,
  5. # this is only for people on the cutting edge.
  6. #
  7. # To run the tests for Google Test itself on Linux, use 'make test' or
  8. # ctest. You can select which tests to run using 'ctest -R regex'.
  9. # For more options, run 'ctest --help'.
  10. ########################################################################
  11. #
  12. # Project-wide settings
  13. # Where gtest's .h files can be found.
  14. include_directories(
  15. ${DXC_GTEST_DIR}/googletest/include
  16. ${DXC_GTEST_DIR}/googletest
  17. ${DXC_GTEST_DIR}/googlemock/include
  18. ${DXC_GTEST_DIR}/googlemock
  19. )
  20. if(WIN32)
  21. add_definitions(-DGTEST_OS_WINDOWS=1)
  22. else(WIN32)
  23. # Disable all warnings in subproject googletest
  24. add_compile_options(-w)
  25. endif(WIN32)
  26. set(LLVM_REQUIRES_RTTI 1)
  27. add_definitions( -DGTEST_HAS_RTTI=0 )
  28. if (NOT LLVM_ENABLE_THREADS)
  29. add_definitions( -DGTEST_HAS_PTHREAD=0 )
  30. endif()
  31. find_library(LLVM_PTHREAD_LIBRARY_PATH pthread)
  32. if (LLVM_PTHREAD_LIBRARY_PATH)
  33. list(APPEND LIBS pthread)
  34. endif()
  35. add_llvm_library(gtest
  36. ${DXC_GTEST_DIR}/googletest/src/gtest-all.cc
  37. ${DXC_GTEST_DIR}/googlemock/src/gmock-all.cc
  38. )