firestore.cmake 1.4 KB

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