firestore.cmake 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # Copyright 2017 Google
  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. include(googletest)
  16. include(grpc)
  17. include(leveldb)
  18. include(nanopb)
  19. include(protobuf)
  20. include(re2)
  21. include(libfuzzer)
  22. if(TARGET Firestore)
  23. return()
  24. endif()
  25. ExternalProject_Add(
  26. Firestore
  27. DEPENDS
  28. googletest
  29. grpc
  30. leveldb
  31. nanopb
  32. protobuf
  33. re2
  34. libfuzzer
  35. # Lay the binary directory out as if this were a subproject. This makes it
  36. # possible to build and test in it directly.
  37. PREFIX ${PROJECT_BINARY_DIR}
  38. SOURCE_DIR ${PROJECT_SOURCE_DIR}/Firestore
  39. BINARY_DIR ${PROJECT_BINARY_DIR}/Firestore
  40. CMAKE_ARGS
  41. -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
  42. -DCMAKE_INSTALL_PREFIX:PATH=${FIREBASE_INSTALL_DIR}
  43. -DWITH_ASAN:BOOL=${WITH_ASAN}
  44. -DWITH_TSAN:BOOL=${WITH_TSAN}
  45. -DWITH_UBSAN:BOOL=${WITH_UBSAN}
  46. -DFUZZING:BOOL=${FUZZING}
  47. BUILD_ALWAYS ON
  48. INSTALL_COMMAND ""
  49. TEST_BEFORE_INSTALL ON
  50. )