googletest.cmake 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # Copyright 2017 Google LLC
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. include(ExternalProject)
  15. if(TARGET googletest OR NOT DOWNLOAD_GOOGLETEST)
  16. return()
  17. endif()
  18. # Note: googletest lives at head and encourages to just point to a head commit.
  19. # https://github.com/google/googletest/blob/bf66935e07/README.md?plain=1#L5-L10
  20. # Commit 4a00a24fff was chosen because it is the _last_ commit before googletest
  21. # dropped c++14 support, setting the floor to c++17. Once Firebase sets _its_
  22. # floor to c++17, this pinned commit can be moved to a new one.
  23. # See https://github.com/firebase/firebase-ios-sdk/pull/14474.
  24. set(version 4a00a24fff)
  25. ExternalProject_Add(
  26. googletest
  27. DOWNLOAD_DIR ${FIREBASE_DOWNLOAD_DIR}
  28. GIT_REPOSITORY https://github.com/google/googletest.git
  29. GIT_TAG "${version}"
  30. PREFIX ${PROJECT_BINARY_DIR}
  31. CONFIGURE_COMMAND ""
  32. BUILD_COMMAND ""
  33. INSTALL_COMMAND ""
  34. TEST_COMMAND ""
  35. HTTP_HEADER "${EXTERNAL_PROJECT_HTTP_HEADER}"
  36. )