mirror of
				https://github.com/Xahau/xahaud.git
				synced 2025-11-04 10:45:50 +00:00 
			
		
		
		
	Streamline pkg and travis CI:
* use tagged containers for pkg build * update build images * continue to build container images in pipeline, but allow failure (non-block) * limit travis macos cache * add vs2019 windows to travis * remove xcode 9 travis build * remove clang5/6 from CI and update min version of Clang required in cmake * break windows CI build into stages to reduce timeouts * update datelib * add if condition to travis builds to allow commit message to limit builds by platform
This commit is contained in:
		
							
								
								
									
										266
									
								
								.travis.yml
									
									
									
									
									
								
							
							
						
						
									
										266
									
								
								.travis.yml
									
									
									
									
									
								
							@@ -4,9 +4,16 @@ dist: xenial
 | 
			
		||||
services:
 | 
			
		||||
  - docker
 | 
			
		||||
 | 
			
		||||
stages:
 | 
			
		||||
  - one
 | 
			
		||||
  - two
 | 
			
		||||
  - three
 | 
			
		||||
  - four
 | 
			
		||||
  - five
 | 
			
		||||
 | 
			
		||||
env:
 | 
			
		||||
  global:
 | 
			
		||||
    - DOCKER_IMAGE="mellery451/rippled-ci-builder:2019-11-27_grpc"
 | 
			
		||||
    - DOCKER_IMAGE="rippleci/rippled-ci-builder:2020-01-08"
 | 
			
		||||
    - CMAKE_EXTRA_ARGS="-Dwerr=ON -Dwextra=ON"
 | 
			
		||||
    - NINJA_BUILD=true
 | 
			
		||||
    # change this if we get more VM capacity
 | 
			
		||||
@@ -22,28 +29,41 @@ env:
 | 
			
		||||
    - CCACHE_NOHASHDIR=true
 | 
			
		||||
    - CCACHE_DIR=${CACHE_DIR}/ccache
 | 
			
		||||
 | 
			
		||||
before_install:
 | 
			
		||||
  - if [ "$(uname)" = "Darwin" ] ; then export NUM_PROCESSORS=$(sysctl -n hw.physicalcpu); else export NUM_PROCESSORS=$(nproc); fi
 | 
			
		||||
  - echo "NUM PROC is ${NUM_PROCESSORS}"
 | 
			
		||||
  - if [ "$(uname)" = "Linux" ] ; then docker pull ${DOCKER_IMAGE}; fi
 | 
			
		||||
  - if [ "${MATRIX_EVAL}" != "" ] ; then eval "${MATRIX_EVAL}"; fi
 | 
			
		||||
  - if [ "${CMAKE_ADD}" != "" ] ; then export CMAKE_EXTRA_ARGS="${CMAKE_EXTRA_ARGS} ${CMAKE_ADD}"; fi
 | 
			
		||||
  - bin/ci/ubuntu/travis-cache-start.sh
 | 
			
		||||
 | 
			
		||||
matrix:
 | 
			
		||||
  fast_finish: true
 | 
			
		||||
  allow_failures:
 | 
			
		||||
    # TODO these all need more investigation
 | 
			
		||||
    # TODO these need more investigation
 | 
			
		||||
    #
 | 
			
		||||
    # current tsan failure might be related to:
 | 
			
		||||
    # https://github.com/google/sanitizers/issues/1104
 | 
			
		||||
    - name: tsan, clang-8
 | 
			
		||||
    # there are a number of UBs caught currently that need triage
 | 
			
		||||
    - name: ubsan, clang-8
 | 
			
		||||
    # this one often runs out of memory:
 | 
			
		||||
    - name: manual tests, gcc-8, release
 | 
			
		||||
 | 
			
		||||
  include:
 | 
			
		||||
    # debug builds
 | 
			
		||||
    - &linux
 | 
			
		||||
      stage: one
 | 
			
		||||
      if: commit_message !~ /travis_run_/ OR commit_message =~ /travis_run_linux/
 | 
			
		||||
      compiler: gcc-8
 | 
			
		||||
      name: gcc-8, debug
 | 
			
		||||
      env:
 | 
			
		||||
        - MATRIX_EVAL="CC=gcc-8 && CXX=g++-8"
 | 
			
		||||
        - BUILD_TYPE=Debug
 | 
			
		||||
      script:
 | 
			
		||||
        - sudo chmod -R a+rw ${CACHE_DIR}
 | 
			
		||||
        - ccache -s
 | 
			
		||||
        - travis_wait ${MAX_TIME_MIN} bin/ci/ubuntu/build-in-docker.sh
 | 
			
		||||
        - ccache -s
 | 
			
		||||
    - <<: *linux
 | 
			
		||||
      compiler: clang-8
 | 
			
		||||
      name: clang-8, debug
 | 
			
		||||
      env:
 | 
			
		||||
        - MATRIX_EVAL="CC=clang-8 && CXX=clang++-8"
 | 
			
		||||
        - BUILD_TYPE=Debug
 | 
			
		||||
    # coverage builds
 | 
			
		||||
    - compiler: gcc-8
 | 
			
		||||
    - <<: *linux
 | 
			
		||||
      if: commit_message !~ /travis_run_/ OR commit_message =~ /travis_run_linux/ OR commit_message =~ /travis_run_cov/
 | 
			
		||||
      compiler: gcc-8
 | 
			
		||||
      name: coverage, gcc-8
 | 
			
		||||
      env:
 | 
			
		||||
        - MATRIX_EVAL="CC=gcc-8 && CXX=g++-8"
 | 
			
		||||
@@ -51,7 +71,9 @@ matrix:
 | 
			
		||||
        - CMAKE_ADD="-Dcoverage=ON"
 | 
			
		||||
        - TARGET=coverage_report
 | 
			
		||||
        - SKIP_TESTS=true
 | 
			
		||||
    - compiler: clang-8
 | 
			
		||||
    - <<: *linux
 | 
			
		||||
      if: commit_message !~ /travis_run_/ OR commit_message =~ /travis_run_linux/ OR commit_message =~ /travis_run_cov/
 | 
			
		||||
      compiler: clang-8
 | 
			
		||||
      name: coverage, clang-8
 | 
			
		||||
      env:
 | 
			
		||||
        - MATRIX_EVAL="CC=clang-8 && CXX=clang++-8"
 | 
			
		||||
@@ -60,27 +82,35 @@ matrix:
 | 
			
		||||
        - TARGET=coverage_report
 | 
			
		||||
        - SKIP_TESTS=true
 | 
			
		||||
    # nounity
 | 
			
		||||
    - compiler: gcc-8
 | 
			
		||||
    - <<: *linux
 | 
			
		||||
      if: commit_message !~ /travis_run_/ OR commit_message =~ /travis_run_linux/ OR commit_message =~ /travis_run_nounity/
 | 
			
		||||
      compiler: gcc-8
 | 
			
		||||
      name: non-unity, gcc-8
 | 
			
		||||
      env:
 | 
			
		||||
        - MATRIX_EVAL="CC=gcc-8 && CXX=g++-8"
 | 
			
		||||
        - BUILD_TYPE=Debug
 | 
			
		||||
        - CMAKE_ADD="-Dunity=OFF"
 | 
			
		||||
    - compiler: clang-8
 | 
			
		||||
    - <<: *linux
 | 
			
		||||
      if: commit_message !~ /travis_run_/ OR commit_message =~ /travis_run_linux/ OR commit_message =~ /travis_run_nounity/
 | 
			
		||||
      compiler: clang-8
 | 
			
		||||
      name: non-unity, clang-8
 | 
			
		||||
      env:
 | 
			
		||||
        - MATRIX_EVAL="CC=clang-8 && CXX=clang++-8"
 | 
			
		||||
        - BUILD_TYPE=Debug
 | 
			
		||||
        - CMAKE_ADD="-Dunity=OFF"
 | 
			
		||||
    # manual tests
 | 
			
		||||
    - compiler: gcc-8
 | 
			
		||||
    - <<: *linux
 | 
			
		||||
      if: commit_message !~ /travis_run_/ OR commit_message =~ /travis_run_linux/ OR commit_message =~ /travis_run_man/
 | 
			
		||||
      compiler: gcc-8
 | 
			
		||||
      name: manual tests, gcc-8, debug
 | 
			
		||||
      env:
 | 
			
		||||
        - MATRIX_EVAL="CC=gcc-8 && CXX=g++-8"
 | 
			
		||||
        - BUILD_TYPE=Debug
 | 
			
		||||
        - MANUAL_TESTS=true
 | 
			
		||||
    # manual tests
 | 
			
		||||
    - compiler: gcc-8
 | 
			
		||||
    - <<: *linux
 | 
			
		||||
      if: commit_message !~ /travis_run_/ OR commit_message =~ /travis_run_linux/ OR commit_message =~ /travis_run_man/
 | 
			
		||||
      compiler: gcc-8
 | 
			
		||||
      name: manual tests, gcc-8, release
 | 
			
		||||
      env:
 | 
			
		||||
        - MATRIX_EVAL="CC=gcc-8 && CXX=g++-8"
 | 
			
		||||
@@ -88,31 +118,26 @@ matrix:
 | 
			
		||||
        - CMAKE_ADD="-Dassert=ON"
 | 
			
		||||
        - MANUAL_TESTS=true
 | 
			
		||||
    # release builds
 | 
			
		||||
    - compiler: gcc-8
 | 
			
		||||
    - <<: *linux
 | 
			
		||||
      if: commit_message !~ /travis_run_/ OR commit_message =~ /travis_run_linux/ OR commit_message =~ /travis_run_release/
 | 
			
		||||
      compiler: gcc-8
 | 
			
		||||
      name: gcc-8, release
 | 
			
		||||
      env:
 | 
			
		||||
        - MATRIX_EVAL="CC=gcc-8 && CXX=g++-8"
 | 
			
		||||
        - BUILD_TYPE=Release
 | 
			
		||||
        - CMAKE_ADD="-Dassert=ON"
 | 
			
		||||
    - compiler: clang-8
 | 
			
		||||
    - <<: *linux
 | 
			
		||||
      if: commit_message !~ /travis_run_/ OR commit_message =~ /travis_run_linux/ OR commit_message =~ /travis_run_release/
 | 
			
		||||
      compiler: clang-8
 | 
			
		||||
      name: clang-8, release
 | 
			
		||||
      env:
 | 
			
		||||
        - MATRIX_EVAL="CC=clang-8 && CXX=clang++-8"
 | 
			
		||||
        - BUILD_TYPE=Release
 | 
			
		||||
        - CMAKE_ADD="-Dassert=ON"
 | 
			
		||||
    # debug builds
 | 
			
		||||
    - compiler: gcc-8
 | 
			
		||||
      name: gcc-8, debug
 | 
			
		||||
      env:
 | 
			
		||||
        - MATRIX_EVAL="CC=gcc-8 && CXX=g++-8"
 | 
			
		||||
        - BUILD_TYPE=Debug
 | 
			
		||||
    - compiler: clang-8
 | 
			
		||||
      name: clang-8, debug
 | 
			
		||||
      env:
 | 
			
		||||
        - MATRIX_EVAL="CC=clang-8 && CXX=clang++-8"
 | 
			
		||||
        - BUILD_TYPE=Debug
 | 
			
		||||
    # asan
 | 
			
		||||
    - compiler: clang-8
 | 
			
		||||
    - <<: *linux
 | 
			
		||||
      if: commit_message !~ /travis_run_/ OR commit_message =~ /travis_run_linux/ OR commit_message =~ /travis_run_san/
 | 
			
		||||
      compiler: clang-8
 | 
			
		||||
      name: asan, clang-8
 | 
			
		||||
      env:
 | 
			
		||||
        - MATRIX_EVAL="CC=clang-8 && CXX=clang++-8"
 | 
			
		||||
@@ -122,7 +147,9 @@ matrix:
 | 
			
		||||
        #- LSAN_OPTIONS="verbosity=1:log_threads=1"
 | 
			
		||||
        - PARALLEL_TESTS=false
 | 
			
		||||
    # ubsan
 | 
			
		||||
    - compiler: clang-8
 | 
			
		||||
    - <<: *linux
 | 
			
		||||
      if: commit_message !~ /travis_run_/ OR commit_message =~ /travis_run_linux/ OR commit_message =~ /travis_run_san/
 | 
			
		||||
      compiler: clang-8
 | 
			
		||||
      name: ubsan, clang-8
 | 
			
		||||
      env:
 | 
			
		||||
        - MATRIX_EVAL="CC=clang-8 && CXX=clang++-8"
 | 
			
		||||
@@ -132,67 +159,70 @@ matrix:
 | 
			
		||||
        - UBSAN_OPTIONS="print_stacktrace=1:report_error_type=1"
 | 
			
		||||
        - PARALLEL_TESTS=false
 | 
			
		||||
    # tsan
 | 
			
		||||
    - compiler: clang-8
 | 
			
		||||
      name: tsan, clang-8
 | 
			
		||||
      env:
 | 
			
		||||
        - MATRIX_EVAL="CC=clang-8 && CXX=clang++-8"
 | 
			
		||||
        - BUILD_TYPE=Release
 | 
			
		||||
        - CMAKE_ADD="-Dsan=thread"
 | 
			
		||||
        - TSAN_OPTIONS="history_size=3 external_symbolizer_path=/usr/bin/llvm-symbolizer verbosity=1"
 | 
			
		||||
        - PARALLEL_TESTS=false
 | 
			
		||||
    # current tsan failure *might* be related to:
 | 
			
		||||
    # https://github.com/google/sanitizers/issues/1104
 | 
			
		||||
    #  but we can't get it to run, so leave it disabled for now
 | 
			
		||||
    #    - <<: *linux
 | 
			
		||||
    #      if: commit_message !~ /travis_run_/ OR commit_message =~ /travis_run_linux/ OR commit_message =~ /travis_run_san/
 | 
			
		||||
    #      compiler: clang-8
 | 
			
		||||
    #      name: tsan, clang-8
 | 
			
		||||
    #      env:
 | 
			
		||||
    #        - MATRIX_EVAL="CC=clang-8 && CXX=clang++-8"
 | 
			
		||||
    #        - BUILD_TYPE=Release
 | 
			
		||||
    #        - CMAKE_ADD="-Dsan=thread"
 | 
			
		||||
    #        - TSAN_OPTIONS="history_size=3 external_symbolizer_path=/usr/bin/llvm-symbolizer verbosity=1"
 | 
			
		||||
    #        - PARALLEL_TESTS=false
 | 
			
		||||
    # dynamic lib builds
 | 
			
		||||
    - compiler: gcc-8
 | 
			
		||||
    - <<: *linux
 | 
			
		||||
      compiler: gcc-8
 | 
			
		||||
      name: non-static, gcc-8
 | 
			
		||||
      env:
 | 
			
		||||
        - MATRIX_EVAL="CC=gcc-8 && CXX=g++-8"
 | 
			
		||||
        - BUILD_TYPE=Debug
 | 
			
		||||
        - CMAKE_ADD="-Dstatic=OFF"
 | 
			
		||||
    - compiler: gcc-8
 | 
			
		||||
    - <<: *linux
 | 
			
		||||
      compiler: gcc-8
 | 
			
		||||
      name: non-static + BUILD_SHARED_LIBS, gcc-8
 | 
			
		||||
      env:
 | 
			
		||||
        - MATRIX_EVAL="CC=gcc-8 && CXX=g++-8"
 | 
			
		||||
        - BUILD_TYPE=Debug
 | 
			
		||||
        - CMAKE_ADD="-Dstatic=OFF -DBUILD_SHARED_LIBS=ON"
 | 
			
		||||
    # makefile
 | 
			
		||||
    - compiler: gcc-8
 | 
			
		||||
    - <<: *linux
 | 
			
		||||
      compiler: gcc-8
 | 
			
		||||
      name: makefile generator, gcc-8
 | 
			
		||||
      env:
 | 
			
		||||
        - MATRIX_EVAL="CC=gcc-8 && CXX=g++-8"
 | 
			
		||||
        - BUILD_TYPE=Debug
 | 
			
		||||
        - NINJA_BUILD=false
 | 
			
		||||
    # misc alternative compilers
 | 
			
		||||
    - compiler: gcc-7
 | 
			
		||||
    - <<: *linux
 | 
			
		||||
      compiler: gcc-7
 | 
			
		||||
      name: gcc-7
 | 
			
		||||
      env:
 | 
			
		||||
        - MATRIX_EVAL="CC=gcc-7 && CXX=g++-7"
 | 
			
		||||
        - BUILD_TYPE=Debug
 | 
			
		||||
    - compiler: gcc-9
 | 
			
		||||
    - <<: *linux
 | 
			
		||||
      compiler: gcc-9
 | 
			
		||||
      name: gcc-9
 | 
			
		||||
      env:
 | 
			
		||||
        - MATRIX_EVAL="CC=gcc-9 && CXX=g++-9"
 | 
			
		||||
        - BUILD_TYPE=Debug
 | 
			
		||||
    - compiler: clang-5.0
 | 
			
		||||
      name: clang-5
 | 
			
		||||
      env:
 | 
			
		||||
        - MATRIX_EVAL="CC=clang-5.0 && CXX=clang++-5.0"
 | 
			
		||||
        - BUILD_TYPE=Debug
 | 
			
		||||
    - compiler: clang-6.0
 | 
			
		||||
      name: clang-6
 | 
			
		||||
      env:
 | 
			
		||||
        - MATRIX_EVAL="CC=clang-6.0 && CXX=clang++-6.0"
 | 
			
		||||
        - BUILD_TYPE=Debug
 | 
			
		||||
    - compiler: clang-7
 | 
			
		||||
    - <<: *linux
 | 
			
		||||
      compiler: clang-7
 | 
			
		||||
      name: clang-7
 | 
			
		||||
      env:
 | 
			
		||||
        - MATRIX_EVAL="CC=clang-7 && CXX=clang++-7"
 | 
			
		||||
        - BUILD_TYPE=Debug
 | 
			
		||||
    - compiler: clang-9
 | 
			
		||||
    - <<: *linux
 | 
			
		||||
      compiler: clang-9
 | 
			
		||||
      name: clang-9
 | 
			
		||||
      env:
 | 
			
		||||
        - MATRIX_EVAL="CC=clang-9 && CXX=clang++-9"
 | 
			
		||||
        - BUILD_TYPE=Debug
 | 
			
		||||
    # verify build with min version of cmake
 | 
			
		||||
    - compiler: gcc-8
 | 
			
		||||
    - <<: *linux
 | 
			
		||||
      compiler: gcc-8
 | 
			
		||||
      name: min cmake version
 | 
			
		||||
      env:
 | 
			
		||||
        - MATRIX_EVAL="CC=gcc-8 && CXX=g++-8"
 | 
			
		||||
@@ -200,7 +230,9 @@ matrix:
 | 
			
		||||
        - CMAKE_EXE=/opt/local/cmake-3.9/bin/cmake
 | 
			
		||||
        - SKIP_TESTS=true
 | 
			
		||||
    # validator keys project as subproj of rippled
 | 
			
		||||
    - compiler: gcc-8
 | 
			
		||||
    - <<: *linux
 | 
			
		||||
      if: commit_message !~ /travis_run_/ OR commit_message =~ /travis_run_vkeys/
 | 
			
		||||
      compiler: gcc-8
 | 
			
		||||
      name: validator-keys
 | 
			
		||||
      env:
 | 
			
		||||
        - MATRIX_EVAL="CC=gcc-8 && CXX=g++-8"
 | 
			
		||||
@@ -209,10 +241,15 @@ matrix:
 | 
			
		||||
        - TARGET=validator-keys
 | 
			
		||||
    # macos
 | 
			
		||||
    - &macos
 | 
			
		||||
      if: commit_message !~ /travis_run_/ OR commit_message =~ /travis_run_mac/
 | 
			
		||||
      stage: one
 | 
			
		||||
      os: osx
 | 
			
		||||
      osx_image: xcode10.2
 | 
			
		||||
      osx_image: xcode10.3
 | 
			
		||||
      name: xcode10, debug
 | 
			
		||||
      env:
 | 
			
		||||
        # put NIH in non-cache location since it seems to
 | 
			
		||||
        # cause failures when homebrew updates
 | 
			
		||||
        - NIH_CACHE_ROOT=${TRAVIS_BUILD_DIR}/nih_c
 | 
			
		||||
        - BLD_CONFIG=Debug
 | 
			
		||||
        - TEST_EXTRA_ARGS=""
 | 
			
		||||
        - BOOST_ROOT=${CACHE_DIR}/boost_1_70_0
 | 
			
		||||
@@ -227,10 +264,13 @@ matrix:
 | 
			
		||||
          packages:
 | 
			
		||||
            - protobuf
 | 
			
		||||
            - grpc
 | 
			
		||||
            - pkg-config
 | 
			
		||||
            - bash
 | 
			
		||||
            - ninja
 | 
			
		||||
            - cmake
 | 
			
		||||
            - wget
 | 
			
		||||
            - zstd
 | 
			
		||||
            - libarchive
 | 
			
		||||
            - openssl@1.1
 | 
			
		||||
          update: true
 | 
			
		||||
      install:
 | 
			
		||||
@@ -252,76 +292,128 @@ matrix:
 | 
			
		||||
      before_script:
 | 
			
		||||
        - export TEST_EXTRA_ARGS="--unittest-ipv6"
 | 
			
		||||
    - <<: *macos
 | 
			
		||||
      osx_image: xcode9.4
 | 
			
		||||
      name: xcode9, debug
 | 
			
		||||
      before_script:
 | 
			
		||||
        # turn off warnings as err for this build
 | 
			
		||||
        - export CMAKE_EXTRA_ARGS="${CMAKE_EXTRA_ARGS} -Dwerr=OFF"
 | 
			
		||||
    - <<: *macos
 | 
			
		||||
      osx_image: xcode11
 | 
			
		||||
      osx_image: xcode11.2
 | 
			
		||||
      name: xcode11, debug
 | 
			
		||||
    # windows
 | 
			
		||||
    - &windows
 | 
			
		||||
      # caching is unreliable on windows...disable for now
 | 
			
		||||
      cache: false
 | 
			
		||||
      if: commit_message !~ /travis_run_/ OR commit_message =~ /travis_run_win/
 | 
			
		||||
      os: windows
 | 
			
		||||
      name: windows, debug
 | 
			
		||||
      env:
 | 
			
		||||
        # put NIH in a non-cached location until
 | 
			
		||||
        # we come up with a way to stabilize that
 | 
			
		||||
        # cache on windows (minimize incremental changes)
 | 
			
		||||
        - CACHE_NAME=win_01
 | 
			
		||||
        - NIH_CACHE_ROOT=${TRAVIS_BUILD_DIR}/nih_c
 | 
			
		||||
        - VCPKG_DEFAULT_TRIPLET="x64-windows-static"
 | 
			
		||||
        - BOOST_ROOT=${CACHE_DIR}/boost_1_70_0
 | 
			
		||||
        - MATRIX_EVAL="CC=cl.exe && CXX=cl.exe"
 | 
			
		||||
        - BOOST_ROOT=${CACHE_DIR}/boost_1_70
 | 
			
		||||
        - >-
 | 
			
		||||
          CMAKE_ADD="
 | 
			
		||||
          -DCMAKE_PREFIX_PATH=${BOOST_ROOT}/_INSTALLED_
 | 
			
		||||
          -DBOOST_ROOT=${BOOST_ROOT}/_INSTALLED_
 | 
			
		||||
          -DBoost_ROOT=${BOOST_ROOT}/_INSTALLED_
 | 
			
		||||
          -DBoost_DIR=${BOOST_ROOT}/_INSTALLED_/lib/cmake/Boost-1.70.0
 | 
			
		||||
          -DBoost_COMPILER=vc141
 | 
			
		||||
          -DCMAKE_VERBOSE_MAKEFILE=ON
 | 
			
		||||
          -DCMAKE_TOOLCHAIN_FILE=${VCPKG_DIR}/scripts/buildsystems/vcpkg.cmake
 | 
			
		||||
          -DVCPKG_TARGET_TRIPLET=x64-windows-static"
 | 
			
		||||
      stage: one
 | 
			
		||||
      name: prereq-ssl
 | 
			
		||||
      install:
 | 
			
		||||
        - choco upgrade cmake.install
 | 
			
		||||
        - choco install ninja visualstudio2017-workload-vctools -y
 | 
			
		||||
        - travis_wait 30 bin/sh/install-vcpkg.sh
 | 
			
		||||
      script:
 | 
			
		||||
        - df -h
 | 
			
		||||
        - travis_wait ${MAX_TIME_MIN} bin/sh/install-vcpkg.sh openssl
 | 
			
		||||
    - <<: *windows
 | 
			
		||||
      stage: two
 | 
			
		||||
      name: prereq-grpc
 | 
			
		||||
      script:
 | 
			
		||||
        - travis_wait ${MAX_TIME_MIN} bin/sh/install-vcpkg.sh grpc
 | 
			
		||||
    - <<: *windows
 | 
			
		||||
      stage: three
 | 
			
		||||
      name: prereq-libarchive
 | 
			
		||||
      script:
 | 
			
		||||
        - travis_wait ${MAX_TIME_MIN} bin/sh/install-vcpkg.sh libarchive[lz4]
 | 
			
		||||
        # TBD consider rocksdb via vcpkg if/when we can build with the 
 | 
			
		||||
        # vcpkg version
 | 
			
		||||
        # - travis_wait ${MAX_TIME_MIN} bin/sh/install-vcpkg.sh rocksdb[snappy,lz4,zlib]
 | 
			
		||||
    - <<: *windows
 | 
			
		||||
      stage: four
 | 
			
		||||
      name: prereq-boost
 | 
			
		||||
      install:
 | 
			
		||||
        - choco upgrade cmake.install
 | 
			
		||||
        - choco install ninja visualstudio2017-workload-vctools -y
 | 
			
		||||
        - choco install visualstudio2019buildtools visualstudio2019community visualstudio2019-workload-vctools -y
 | 
			
		||||
      script:
 | 
			
		||||
        - export BOOST_TOOLSET=msvc-14.1
 | 
			
		||||
        - travis_wait ${MAX_TIME_MIN} Builds/containers/shared/install_boost.sh
 | 
			
		||||
    - &windows-bld
 | 
			
		||||
      <<: *windows
 | 
			
		||||
      stage: five
 | 
			
		||||
      name: windows, debug
 | 
			
		||||
      before_script:
 | 
			
		||||
        - export BLD_CONFIG=Debug
 | 
			
		||||
      script:
 | 
			
		||||
        - df -h
 | 
			
		||||
        - . ./bin/sh/setup-msvc.sh
 | 
			
		||||
        - mkdir -p build.ms && cd build.ms
 | 
			
		||||
        - cmake -G Ninja ${CMAKE_EXTRA_ARGS} -DCMAKE_BUILD_TYPE=${BLD_CONFIG} ..
 | 
			
		||||
        - travis_wait ${MAX_TIME_MIN} cmake --build . --parallel --verbose
 | 
			
		||||
        - ./rippled.exe --unittest --quiet --unittest-log --unittest-jobs ${NUM_PROCESSORS}
 | 
			
		||||
    - <<: *windows
 | 
			
		||||
        # override num procs to force single unit test job
 | 
			
		||||
        - export NUM_PROCESSORS=1
 | 
			
		||||
        - travis_wait ${MAX_TIME_MIN} ./rippled.exe --unittest --quiet --unittest-log --unittest-jobs ${NUM_PROCESSORS}
 | 
			
		||||
    - <<: *windows-bld
 | 
			
		||||
      name: windows, release
 | 
			
		||||
      before_script:
 | 
			
		||||
        - export BLD_CONFIG=Release
 | 
			
		||||
    - <<: *windows
 | 
			
		||||
    - <<: *windows-bld
 | 
			
		||||
      name: windows, visual studio, debug
 | 
			
		||||
      script:
 | 
			
		||||
        - mkdir -p build.ms && cd build.ms
 | 
			
		||||
        - cmake -G "Visual Studio 15 2017 Win64" ${CMAKE_EXTRA_ARGS} ..
 | 
			
		||||
        - export DESTDIR=${PWD}/_installed_
 | 
			
		||||
        - travis_wait ${MAX_TIME_MIN} cmake --build . --parallel --verbose --config ${BLD_CONFIG} --target install
 | 
			
		||||
        # override num procs to force single unit test job
 | 
			
		||||
        - export NUM_PROCESSORS=1
 | 
			
		||||
        - >-
 | 
			
		||||
          "./_installed_/Program Files/rippled/bin/rippled.exe" --unittest --quiet --unittest-log --unittest-jobs ${NUM_PROCESSORS}
 | 
			
		||||
          travis_wait ${MAX_TIME_MIN} "./_installed_/Program Files/rippled/bin/rippled.exe" --unittest --quiet --unittest-log --unittest-jobs ${NUM_PROCESSORS}
 | 
			
		||||
    - <<: *windows-bld
 | 
			
		||||
      name: windows, vc2019
 | 
			
		||||
      install:
 | 
			
		||||
        - choco upgrade cmake.install
 | 
			
		||||
        - choco install ninja -y
 | 
			
		||||
        - choco install visualstudio2019buildtools visualstudio2019community visualstudio2019-workload-vctools -y
 | 
			
		||||
      before_script:
 | 
			
		||||
        - export BLD_CONFIG=Release
 | 
			
		||||
        # we want to use the boost build from cache, which was built using the
 | 
			
		||||
        # vs2017 compiler so we need to specify the Boost_COMPILER. BUT, we
 | 
			
		||||
        # can't use the cmake config files generated by boost b/c they are
 | 
			
		||||
        # broken for Boost_COMPILER override, so we need to specify both
 | 
			
		||||
        # Boost_NO_BOOST_CMAKE and a slightly different Boost_COMPILER string
 | 
			
		||||
        # to make the legacy find module work for us. If the cmake configs are
 | 
			
		||||
        # fixed in the future, it should be possible to remove these
 | 
			
		||||
        # workarounds.
 | 
			
		||||
        - export CMAKE_EXTRA_ARGS="${CMAKE_EXTRA_ARGS} -DBoost_NO_BOOST_CMAKE=ON -DBoost_COMPILER=-vc141"
 | 
			
		||||
 | 
			
		||||
cache:
 | 
			
		||||
  timeout: 900
 | 
			
		||||
  directories:
 | 
			
		||||
    - $CACHE_DIR
 | 
			
		||||
before_cache:
 | 
			
		||||
  - if [ $(uname) = "Linux" ] ; then SUDO="sudo"; else SUDO=""; fi
 | 
			
		||||
  - cd ${TRAVIS_HOME}
 | 
			
		||||
  - if [ -f cache_ignore.tar ] ; then $SUDO tar xvf cache_ignore.tar; fi
 | 
			
		||||
  - cd ${TRAVIS_BUILD_DIR}
 | 
			
		||||
 | 
			
		||||
script:
 | 
			
		||||
  - sudo chmod -R a+rw ${CACHE_DIR}
 | 
			
		||||
  - ccache -s
 | 
			
		||||
  - travis_wait ${MAX_TIME_MIN} bin/ci/ubuntu/build-in-docker.sh
 | 
			
		||||
  - ccache -s
 | 
			
		||||
cache:
 | 
			
		||||
  timeout: 900
 | 
			
		||||
  directories:
 | 
			
		||||
    - $CACHE_DIR
 | 
			
		||||
 | 
			
		||||
before_install:
 | 
			
		||||
  - if [ "$(uname)" = "Darwin" ] ; then export NUM_PROCESSORS=$(sysctl -n hw.physicalcpu); else export NUM_PROCESSORS=$(nproc); fi
 | 
			
		||||
  - echo "NUM PROC is ${NUM_PROCESSORS}"
 | 
			
		||||
  - if [ "$(uname)" = "Linux" ] ; then docker pull ${DOCKER_IMAGE}; fi
 | 
			
		||||
  - if [ "${MATRIX_EVAL}" != "" ] ; then eval "${MATRIX_EVAL}"; fi
 | 
			
		||||
  - if [ "${CMAKE_ADD}" != "" ] ; then export CMAKE_EXTRA_ARGS="${CMAKE_EXTRA_ARGS} ${CMAKE_ADD}"; fi
 | 
			
		||||
  - bin/ci/ubuntu/travis-cache-start.sh
 | 
			
		||||
 | 
			
		||||
notifications:
 | 
			
		||||
  email: false
 | 
			
		||||
 
 | 
			
		||||
@@ -38,6 +38,11 @@ if (MSVC)
 | 
			
		||||
 | 
			
		||||
    # /ZI (Edit & Continue debugging information) is incompatible with Gy-
 | 
			
		||||
    string (REPLACE "/ZI" "/Zi" ${var_} "${${var_}}")
 | 
			
		||||
 | 
			
		||||
    # omit debug info completely under CI (not needed)
 | 
			
		||||
    if (is_ci)
 | 
			
		||||
      string (REPLACE "/Zi" " " ${var_} "${${var_}}")
 | 
			
		||||
    endif ()
 | 
			
		||||
  endforeach ()
 | 
			
		||||
 | 
			
		||||
  target_compile_options (common
 | 
			
		||||
 
 | 
			
		||||
@@ -141,17 +141,25 @@ if (is_root_project)
 | 
			
		||||
    # now use the same ubuntu image for our travis-ci docker images,
 | 
			
		||||
    # but we use a newer distro (18.04 vs 16.04).
 | 
			
		||||
    #
 | 
			
		||||
    # the following steps assume the github pkg repo, but it's possible to
 | 
			
		||||
    # adapt these for other docker hub repositories.
 | 
			
		||||
    #
 | 
			
		||||
    # steps for publishing a new CI image when you make changes:
 | 
			
		||||
    #
 | 
			
		||||
    #   mkdir bld.ci && cd bld.ci && cmake -Dpackages_only=ON -Dcontainer_label=CI_LATEST
 | 
			
		||||
    #   cmake --build . --target ci_container --verbose
 | 
			
		||||
    #   docker tag rippled-ci-builder:CI_LATEST <DOCKERHUB_USER>/rippled-ci-builder:YYYY-MM-DD
 | 
			
		||||
    #       (change YYYY-MM-DD to match current date..or use a different
 | 
			
		||||
    #        tag/label scheme if you prefer)
 | 
			
		||||
    #   docker push <DOCKERHUB_USER>/rippled-ci-builder:YYYY-MM-DD
 | 
			
		||||
    #   docker tag rippled-ci-builder:CI_LATEST <HUB REPO PATH>/rippled-ci-builder:YYYY-MM-DD
 | 
			
		||||
    #      (NOTE: change YYYY-MM-DD to match current date, or use a different
 | 
			
		||||
    #             tag/version scheme if you prefer)
 | 
			
		||||
    #   docker push <HUB REPO PATH>/rippled-ci-builder:YYYY-MM-DD
 | 
			
		||||
    #      (NOTE: <HUB REPO PATH> is probably your user or org name if using
 | 
			
		||||
    #             docker hub, or it might be something like
 | 
			
		||||
    #             docker.pkg.github.com/ripple/rippled if using the github pkg
 | 
			
		||||
    #             registry. for any registry, you will need to be logged-in via
 | 
			
		||||
    #             docker and have push access.)
 | 
			
		||||
    #
 | 
			
		||||
    # ...then change the DOCKER_IMAGE line in .travis.yml :
 | 
			
		||||
    #     - DOCKER_IMAGE="<DOCKERHUB_USER>/rippled-ci-builder:YYYY-MM-DD"
 | 
			
		||||
    #     - DOCKER_IMAGE="<HUB REPO PATH>/rippled-ci-builder:YYYY-MM-DD"
 | 
			
		||||
    add_custom_target (ci_container
 | 
			
		||||
      docker build
 | 
			
		||||
        --pull
 | 
			
		||||
 
 | 
			
		||||
@@ -39,8 +39,8 @@ endif ()
 | 
			
		||||
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES ".*Clang") # both Clang and AppleClang
 | 
			
		||||
  set (is_clang TRUE)
 | 
			
		||||
  if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND
 | 
			
		||||
         CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
 | 
			
		||||
    message (FATAL_ERROR "This project requires clang 5 or later")
 | 
			
		||||
         CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)
 | 
			
		||||
    message (FATAL_ERROR "This project requires clang 7 or later")
 | 
			
		||||
  endif ()
 | 
			
		||||
  # TODO min AppleClang version check ?
 | 
			
		||||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
 | 
			
		||||
 
 | 
			
		||||
@@ -36,6 +36,8 @@ if (static AND NOT APPLE)
 | 
			
		||||
else ()
 | 
			
		||||
  set (Boost_USE_STATIC_RUNTIME OFF)
 | 
			
		||||
endif ()
 | 
			
		||||
# TBD:
 | 
			
		||||
# Boost_USE_DEBUG_RUNTIME:  When ON, uses Boost libraries linked against the
 | 
			
		||||
find_package (Boost 1.70 REQUIRED
 | 
			
		||||
  COMPONENTS
 | 
			
		||||
    chrono
 | 
			
		||||
@@ -70,7 +72,12 @@ target_link_libraries (ripple_boost
 | 
			
		||||
    Boost::serialization
 | 
			
		||||
    Boost::system
 | 
			
		||||
    Boost::thread)
 | 
			
		||||
if (san)
 | 
			
		||||
if (Boost_COMPILER)
 | 
			
		||||
  target_link_libraries (ripple_boost INTERFACE Boost::disable_autolinking)
 | 
			
		||||
endif ()
 | 
			
		||||
if (san AND is_clang)
 | 
			
		||||
  # TODO: gcc does not support -fsanitize-blacklist...can we do something else 
 | 
			
		||||
  # for gcc ?
 | 
			
		||||
  if (NOT Boost_INCLUDE_DIRS AND TARGET Boost::headers)
 | 
			
		||||
    get_target_property (Boost_INCLUDE_DIRS Boost::headers INTERFACE_INCLUDE_DIRECTORIES)
 | 
			
		||||
  endif ()
 | 
			
		||||
 
 | 
			
		||||
@@ -7,7 +7,6 @@ else()
 | 
			
		||||
  set(LIBARCHIVE_LIB archive)
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
find_library (archive
 | 
			
		||||
  NAMES ${LIBARCHIVE_LIB}
 | 
			
		||||
  HINTS
 | 
			
		||||
@@ -1,5 +1,7 @@
 | 
			
		||||
find_package (PkgConfig REQUIRED)
 | 
			
		||||
pkg_search_module (lz4_PC QUIET liblz4>=1.8)
 | 
			
		||||
find_package (PkgConfig)
 | 
			
		||||
if (PKG_CONFIG_FOUND)
 | 
			
		||||
  pkg_search_module (lz4_PC QUIET liblz4>=1.8)
 | 
			
		||||
endif ()
 | 
			
		||||
 | 
			
		||||
if(static)
 | 
			
		||||
  set(LZ4_LIB liblz4.a)
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,7 @@
 | 
			
		||||
find_package (PkgConfig REQUIRED)
 | 
			
		||||
pkg_search_module (secp256k1_PC QUIET libsecp256k1)
 | 
			
		||||
find_package (PkgConfig)
 | 
			
		||||
if (PKG_CONFIG_FOUND)
 | 
			
		||||
  pkg_search_module (secp256k1_PC QUIET libsecp256k1)
 | 
			
		||||
endif ()
 | 
			
		||||
 | 
			
		||||
if(static)
 | 
			
		||||
  set(SECP256K1_LIB libsecp256k1.a)
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,7 @@
 | 
			
		||||
find_package (PkgConfig REQUIRED)
 | 
			
		||||
pkg_search_module (snappy_PC QUIET snappy>=1.1.7)
 | 
			
		||||
find_package (PkgConfig)
 | 
			
		||||
if (PKG_CONFIG_FOUND)
 | 
			
		||||
  pkg_search_module (snappy_PC QUIET snappy>=1.1.7)
 | 
			
		||||
endif ()
 | 
			
		||||
 | 
			
		||||
if(static)
 | 
			
		||||
  set(SNAPPY_LIB libsnappy.a)
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,8 @@
 | 
			
		||||
find_package (PkgConfig REQUIRED)
 | 
			
		||||
 | 
			
		||||
# no soci pkgconfig
 | 
			
		||||
#pkg_search_module (soci_PC QUIET libsoci_core>=3.2)
 | 
			
		||||
find_package (PkgConfig)
 | 
			
		||||
if (PKG_CONFIG_FOUND)
 | 
			
		||||
  # TBD - currently no soci pkgconfig
 | 
			
		||||
  #pkg_search_module (soci_PC QUIET libsoci_core>=3.2)
 | 
			
		||||
endif ()
 | 
			
		||||
 | 
			
		||||
if(static)
 | 
			
		||||
  set(SOCI_LIB libsoci.a)
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,7 @@
 | 
			
		||||
find_package (PkgConfig REQUIRED)
 | 
			
		||||
pkg_search_module (sqlite_PC QUIET sqlite3>=3.26.0)
 | 
			
		||||
find_package (PkgConfig)
 | 
			
		||||
if (PKG_CONFIG_FOUND)
 | 
			
		||||
  pkg_search_module (sqlite_PC QUIET sqlite3>=3.26.0)
 | 
			
		||||
endif ()
 | 
			
		||||
 | 
			
		||||
if(static)
 | 
			
		||||
  set(SQLITE_LIB libsqlite3.a)
 | 
			
		||||
 
 | 
			
		||||
@@ -2,22 +2,58 @@
 | 
			
		||||
   NIH dep: libarchive
 | 
			
		||||
#]===================================================================]
 | 
			
		||||
 | 
			
		||||
option (local_libarchive "use local build of libarchive." OFF)
 | 
			
		||||
add_library (archive_lib STATIC IMPORTED GLOBAL)
 | 
			
		||||
 | 
			
		||||
if (NOT WIN32)
 | 
			
		||||
  find_package(libarchive REQUIRED)
 | 
			
		||||
if (NOT local_libarchive)
 | 
			
		||||
  if (NOT WIN32)
 | 
			
		||||
    find_package(libarchive_pc REQUIRED)
 | 
			
		||||
  endif ()
 | 
			
		||||
  if (archive)
 | 
			
		||||
    message (STATUS "Found libarchive using pkg-config. Using ${archive}.")
 | 
			
		||||
    set_target_properties (archive_lib PROPERTIES
 | 
			
		||||
      IMPORTED_LOCATION_DEBUG
 | 
			
		||||
        ${archive}
 | 
			
		||||
      IMPORTED_LOCATION_RELEASE
 | 
			
		||||
        ${archive}
 | 
			
		||||
      INTERFACE_INCLUDE_DIRECTORIES
 | 
			
		||||
        ${LIBARCHIVE_INCLUDE_DIR})
 | 
			
		||||
  else ()
 | 
			
		||||
    ## now try searching using the minimal find module that cmake provides
 | 
			
		||||
    find_package(LibArchive 3.3.3 QUIET)
 | 
			
		||||
    if (LibArchive_FOUND)
 | 
			
		||||
      if (static)
 | 
			
		||||
        # find module doesn't find static libs currently, so we re-search
 | 
			
		||||
        get_filename_component(_loc ${LibArchive_LIBRARY} DIRECTORY)
 | 
			
		||||
        find_library(_la_static
 | 
			
		||||
          NAMES libarchive.a archive_static.lib
 | 
			
		||||
          PATHS ${_loc})
 | 
			
		||||
        if (_la_static)
 | 
			
		||||
          set (_la_lib ${_la_static})
 | 
			
		||||
        else ()
 | 
			
		||||
          message (WARNING "unable to find libarchive static lib - switching to local build")
 | 
			
		||||
          set (local_libarchive ON CACHE BOOL "" FORCE)
 | 
			
		||||
        endif ()
 | 
			
		||||
      else ()
 | 
			
		||||
        set (_la_lib ${LibArchive_LIBRARY})
 | 
			
		||||
      endif ()
 | 
			
		||||
      if (NOT local_libarchive)
 | 
			
		||||
        message (STATUS "Found libarchive using module/config. Using ${_la_lib}.")
 | 
			
		||||
        set_target_properties (archive_lib PROPERTIES
 | 
			
		||||
          IMPORTED_LOCATION_DEBUG
 | 
			
		||||
            ${_la_lib}
 | 
			
		||||
          IMPORTED_LOCATION_RELEASE
 | 
			
		||||
            ${_la_lib}
 | 
			
		||||
          INTERFACE_INCLUDE_DIRECTORIES
 | 
			
		||||
            ${LibArchive_INCLUDE_DIRS})
 | 
			
		||||
      endif ()
 | 
			
		||||
    else ()
 | 
			
		||||
      set (local_libarchive ON CACHE BOOL "" FORCE)
 | 
			
		||||
    endif ()
 | 
			
		||||
  endif ()
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
if(libarchive)
 | 
			
		||||
  set_target_properties (archive_lib PROPERTIES
 | 
			
		||||
    IMPORTED_LOCATION_DEBUG
 | 
			
		||||
      ${archive}
 | 
			
		||||
    IMPORTED_LOCATION_RELEASE
 | 
			
		||||
      ${archive}
 | 
			
		||||
    INTERFACE_INCLUDE_DIRECTORIES
 | 
			
		||||
      ${LIBARCHIVE_INCLUDE_DIR})
 | 
			
		||||
 | 
			
		||||
else()
 | 
			
		||||
if (local_libarchive)
 | 
			
		||||
  set (lib_post "")
 | 
			
		||||
  if (MSVC)
 | 
			
		||||
    set (lib_post "_static")
 | 
			
		||||
 
 | 
			
		||||
@@ -2,114 +2,127 @@
 | 
			
		||||
   NIH dep: rocksdb
 | 
			
		||||
#]===================================================================]
 | 
			
		||||
 | 
			
		||||
ExternalProject_Add (rocksdb
 | 
			
		||||
  PREFIX ${nih_cache_path}
 | 
			
		||||
  GIT_REPOSITORY https://github.com/facebook/rocksdb.git
 | 
			
		||||
  GIT_TAG v5.17.2
 | 
			
		||||
  PATCH_COMMAND
 | 
			
		||||
    # only used by windows build
 | 
			
		||||
    ${CMAKE_COMMAND} -E copy
 | 
			
		||||
    ${CMAKE_SOURCE_DIR}/Builds/CMake/rocks_thirdparty.inc
 | 
			
		||||
    <SOURCE_DIR>/thirdparty.inc
 | 
			
		||||
  COMMAND
 | 
			
		||||
    # fixup their build version file to keep the values
 | 
			
		||||
    # from changing always
 | 
			
		||||
    ${CMAKE_COMMAND} -E copy_if_different
 | 
			
		||||
    ${CMAKE_SOURCE_DIR}/Builds/CMake/rocksdb_build_version.cc.in
 | 
			
		||||
    <SOURCE_DIR>/util/build_version.cc.in
 | 
			
		||||
  CMAKE_ARGS
 | 
			
		||||
    -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
 | 
			
		||||
    -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
 | 
			
		||||
    $<$<BOOL:${CMAKE_VERBOSE_MAKEFILE}>:-DCMAKE_VERBOSE_MAKEFILE=ON>
 | 
			
		||||
    -DCMAKE_DEBUG_POSTFIX=_d
 | 
			
		||||
    $<$<NOT:$<BOOL:${is_multiconfig}>>:-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}>
 | 
			
		||||
    -DBUILD_SHARED_LIBS=OFF
 | 
			
		||||
    -DCMAKE_POSITION_INDEPENDENT_CODE=ON
 | 
			
		||||
    -DWITH_JEMALLOC=$<IF:$<BOOL:${jemalloc}>,ON,OFF>
 | 
			
		||||
    -DWITH_SNAPPY=ON
 | 
			
		||||
    -DWITH_LZ4=ON
 | 
			
		||||
    -DWITH_ZLIB=OFF
 | 
			
		||||
    -DUSE_RTTI=ON
 | 
			
		||||
    -DWITH_ZSTD=OFF
 | 
			
		||||
    -DWITH_GFLAGS=OFF
 | 
			
		||||
    -DWITH_BZ2=OFF
 | 
			
		||||
    -ULZ4_*
 | 
			
		||||
    -DLZ4_INCLUDE_DIR=$<JOIN:$<TARGET_PROPERTY:lz4_lib,INTERFACE_INCLUDE_DIRECTORIES>,::>
 | 
			
		||||
    -DLZ4_LIBRARIES=$<IF:$<CONFIG:Debug>,$<TARGET_PROPERTY:lz4_lib,IMPORTED_LOCATION_DEBUG>,$<TARGET_PROPERTY:lz4_lib,IMPORTED_LOCATION_RELEASE>>
 | 
			
		||||
    -DLZ4_FOUND=ON
 | 
			
		||||
    -USNAPPY_*
 | 
			
		||||
    -DSNAPPY_INCLUDE_DIR=$<JOIN:$<TARGET_PROPERTY:snappy_lib,INTERFACE_INCLUDE_DIRECTORIES>,::>
 | 
			
		||||
    -DSNAPPY_LIBRARIES=$<IF:$<CONFIG:Debug>,$<TARGET_PROPERTY:snappy_lib,IMPORTED_LOCATION_DEBUG>,$<TARGET_PROPERTY:snappy_lib,IMPORTED_LOCATION_RELEASE>>
 | 
			
		||||
    -DSNAPPY_FOUND=ON
 | 
			
		||||
    -DWITH_MD_LIBRARY=OFF
 | 
			
		||||
    -DWITH_RUNTIME_DEBUG=$<IF:$<CONFIG:Debug>,ON,OFF>
 | 
			
		||||
    -DFAIL_ON_WARNINGS=OFF
 | 
			
		||||
    -DWITH_ASAN=OFF
 | 
			
		||||
    -DWITH_TSAN=OFF
 | 
			
		||||
    -DWITH_UBSAN=OFF
 | 
			
		||||
    -DWITH_NUMA=OFF
 | 
			
		||||
    -DWITH_TBB=OFF
 | 
			
		||||
    -DWITH_WINDOWS_UTF8_FILENAMES=OFF
 | 
			
		||||
    -DWITH_XPRESS=OFF
 | 
			
		||||
    -DPORTABLE=ON
 | 
			
		||||
    -DFORCE_SSE42=OFF
 | 
			
		||||
    -DDISABLE_STALL_NOTIF=OFF
 | 
			
		||||
    -DOPTDBG=ON
 | 
			
		||||
    -DROCKSDB_LITE=OFF
 | 
			
		||||
    -DWITH_FALLOCATE=ON
 | 
			
		||||
    -DWITH_LIBRADOS=OFF
 | 
			
		||||
    -DWITH_JNI=OFF
 | 
			
		||||
    -DROCKSDB_INSTALL_ON_WINDOWS=OFF
 | 
			
		||||
    -DWITH_TESTS=OFF
 | 
			
		||||
    -DWITH_TOOLS=OFF
 | 
			
		||||
    $<$<BOOL:${MSVC}>:
 | 
			
		||||
      "-DCMAKE_CXX_FLAGS=-GR -Gd -fp:precise -FS -MP /DNDEBUG"
 | 
			
		||||
    >
 | 
			
		||||
    $<$<NOT:$<BOOL:${MSVC}>>:
 | 
			
		||||
      "-DCMAKE_CXX_FLAGS=-DNDEBUG"
 | 
			
		||||
    >
 | 
			
		||||
  LOG_BUILD ON
 | 
			
		||||
  LOG_CONFIGURE ON
 | 
			
		||||
  BUILD_COMMAND
 | 
			
		||||
    ${CMAKE_COMMAND}
 | 
			
		||||
    --build .
 | 
			
		||||
    --config $<CONFIG>
 | 
			
		||||
    $<$<VERSION_GREATER_EQUAL:${CMAKE_VERSION},3.12>:--parallel ${ep_procs}>
 | 
			
		||||
    $<$<BOOL:${is_multiconfig}>:
 | 
			
		||||
      COMMAND
 | 
			
		||||
        ${CMAKE_COMMAND} -E copy
 | 
			
		||||
        <BINARY_DIR>/$<CONFIG>/${ep_lib_prefix}rocksdb$<$<CONFIG:Debug>:_d>${ep_lib_suffix}
 | 
			
		||||
        <BINARY_DIR>
 | 
			
		||||
find_package (RocksDB CONFIG QUIET)
 | 
			
		||||
if (TARGET RocksDB::rocksdb)
 | 
			
		||||
  get_target_property (_rockslib_l RocksDB::rocksdb IMPORTED_LOCATION_DEBUG)
 | 
			
		||||
  if (NOT _rockslib_l)
 | 
			
		||||
    get_target_property (_rockslib_l RocksDB::rocksdb IMPORTED_LOCATION_RELEASE)
 | 
			
		||||
  endif ()
 | 
			
		||||
  if (NOT _rockslib_l)
 | 
			
		||||
    get_target_property (_rockslib_l RocksDB::rocksdb IMPORTED_LOCATION)
 | 
			
		||||
  endif ()
 | 
			
		||||
  message (STATUS "Found RocksDB using module/config. Using ${_rockslib_l}.")
 | 
			
		||||
  target_link_libraries (ripple_libs INTERFACE RocksDB::rocksdb)
 | 
			
		||||
else ()
 | 
			
		||||
  add_library (rocksdb_lib STATIC IMPORTED GLOBAL)
 | 
			
		||||
  ExternalProject_Add (rocksdb
 | 
			
		||||
    PREFIX ${nih_cache_path}
 | 
			
		||||
    GIT_REPOSITORY https://github.com/facebook/rocksdb.git
 | 
			
		||||
    GIT_TAG v5.17.2
 | 
			
		||||
    PATCH_COMMAND
 | 
			
		||||
      # only used by windows build
 | 
			
		||||
      ${CMAKE_COMMAND} -E copy
 | 
			
		||||
      ${CMAKE_SOURCE_DIR}/Builds/CMake/rocks_thirdparty.inc
 | 
			
		||||
      <SOURCE_DIR>/thirdparty.inc
 | 
			
		||||
    COMMAND
 | 
			
		||||
      # fixup their build version file to keep the values
 | 
			
		||||
      # from changing always
 | 
			
		||||
      ${CMAKE_COMMAND} -E copy_if_different
 | 
			
		||||
      ${CMAKE_SOURCE_DIR}/Builds/CMake/rocksdb_build_version.cc.in
 | 
			
		||||
      <SOURCE_DIR>/util/build_version.cc.in
 | 
			
		||||
    CMAKE_ARGS
 | 
			
		||||
      -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
 | 
			
		||||
      -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
 | 
			
		||||
      $<$<BOOL:${CMAKE_VERBOSE_MAKEFILE}>:-DCMAKE_VERBOSE_MAKEFILE=ON>
 | 
			
		||||
      -DCMAKE_DEBUG_POSTFIX=_d
 | 
			
		||||
      $<$<NOT:$<BOOL:${is_multiconfig}>>:-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}>
 | 
			
		||||
      -DBUILD_SHARED_LIBS=OFF
 | 
			
		||||
      -DCMAKE_POSITION_INDEPENDENT_CODE=ON
 | 
			
		||||
      -DWITH_JEMALLOC=$<IF:$<BOOL:${jemalloc}>,ON,OFF>
 | 
			
		||||
      -DWITH_SNAPPY=ON
 | 
			
		||||
      -DWITH_LZ4=ON
 | 
			
		||||
      -DWITH_ZLIB=OFF
 | 
			
		||||
      -DUSE_RTTI=ON
 | 
			
		||||
      -DWITH_ZSTD=OFF
 | 
			
		||||
      -DWITH_GFLAGS=OFF
 | 
			
		||||
      -DWITH_BZ2=OFF
 | 
			
		||||
      -ULZ4_*
 | 
			
		||||
      -DLZ4_INCLUDE_DIR=$<JOIN:$<TARGET_PROPERTY:lz4_lib,INTERFACE_INCLUDE_DIRECTORIES>,::>
 | 
			
		||||
      -DLZ4_LIBRARIES=$<IF:$<CONFIG:Debug>,$<TARGET_PROPERTY:lz4_lib,IMPORTED_LOCATION_DEBUG>,$<TARGET_PROPERTY:lz4_lib,IMPORTED_LOCATION_RELEASE>>
 | 
			
		||||
      -DLZ4_FOUND=ON
 | 
			
		||||
      -USNAPPY_*
 | 
			
		||||
      -DSNAPPY_INCLUDE_DIR=$<JOIN:$<TARGET_PROPERTY:snappy_lib,INTERFACE_INCLUDE_DIRECTORIES>,::>
 | 
			
		||||
      -DSNAPPY_LIBRARIES=$<IF:$<CONFIG:Debug>,$<TARGET_PROPERTY:snappy_lib,IMPORTED_LOCATION_DEBUG>,$<TARGET_PROPERTY:snappy_lib,IMPORTED_LOCATION_RELEASE>>
 | 
			
		||||
      -DSNAPPY_FOUND=ON
 | 
			
		||||
      -DWITH_MD_LIBRARY=OFF
 | 
			
		||||
      -DWITH_RUNTIME_DEBUG=$<IF:$<CONFIG:Debug>,ON,OFF>
 | 
			
		||||
      -DFAIL_ON_WARNINGS=OFF
 | 
			
		||||
      -DWITH_ASAN=OFF
 | 
			
		||||
      -DWITH_TSAN=OFF
 | 
			
		||||
      -DWITH_UBSAN=OFF
 | 
			
		||||
      -DWITH_NUMA=OFF
 | 
			
		||||
      -DWITH_TBB=OFF
 | 
			
		||||
      -DWITH_WINDOWS_UTF8_FILENAMES=OFF
 | 
			
		||||
      -DWITH_XPRESS=OFF
 | 
			
		||||
      -DPORTABLE=ON
 | 
			
		||||
      -DFORCE_SSE42=OFF
 | 
			
		||||
      -DDISABLE_STALL_NOTIF=OFF
 | 
			
		||||
      -DOPTDBG=ON
 | 
			
		||||
      -DROCKSDB_LITE=OFF
 | 
			
		||||
      -DWITH_FALLOCATE=ON
 | 
			
		||||
      -DWITH_LIBRADOS=OFF
 | 
			
		||||
      -DWITH_JNI=OFF
 | 
			
		||||
      -DROCKSDB_INSTALL_ON_WINDOWS=OFF
 | 
			
		||||
      -DWITH_TESTS=OFF
 | 
			
		||||
      -DWITH_TOOLS=OFF
 | 
			
		||||
      $<$<BOOL:${MSVC}>:
 | 
			
		||||
        "-DCMAKE_CXX_FLAGS=-GR -Gd -fp:precise -FS -MP /DNDEBUG"
 | 
			
		||||
      >
 | 
			
		||||
  LIST_SEPARATOR ::
 | 
			
		||||
  TEST_COMMAND ""
 | 
			
		||||
  INSTALL_COMMAND ""
 | 
			
		||||
  DEPENDS snappy_lib lz4_lib
 | 
			
		||||
  BUILD_BYPRODUCTS
 | 
			
		||||
    <BINARY_DIR>/${ep_lib_prefix}rocksdb${ep_lib_suffix}
 | 
			
		||||
    <BINARY_DIR>/${ep_lib_prefix}rocksdb_d${ep_lib_suffix}
 | 
			
		||||
)
 | 
			
		||||
ExternalProject_Get_Property (rocksdb BINARY_DIR)
 | 
			
		||||
ExternalProject_Get_Property (rocksdb SOURCE_DIR)
 | 
			
		||||
if (CMAKE_VERBOSE_MAKEFILE)
 | 
			
		||||
  print_ep_logs (rocksdb)
 | 
			
		||||
      $<$<NOT:$<BOOL:${MSVC}>>:
 | 
			
		||||
        "-DCMAKE_CXX_FLAGS=-DNDEBUG"
 | 
			
		||||
      >
 | 
			
		||||
    LOG_BUILD ON
 | 
			
		||||
    LOG_CONFIGURE ON
 | 
			
		||||
    BUILD_COMMAND
 | 
			
		||||
      ${CMAKE_COMMAND}
 | 
			
		||||
      --build .
 | 
			
		||||
      --config $<CONFIG>
 | 
			
		||||
      $<$<VERSION_GREATER_EQUAL:${CMAKE_VERSION},3.12>:--parallel ${ep_procs}>
 | 
			
		||||
      $<$<BOOL:${is_multiconfig}>:
 | 
			
		||||
        COMMAND
 | 
			
		||||
          ${CMAKE_COMMAND} -E copy
 | 
			
		||||
          <BINARY_DIR>/$<CONFIG>/${ep_lib_prefix}rocksdb$<$<CONFIG:Debug>:_d>${ep_lib_suffix}
 | 
			
		||||
          <BINARY_DIR>
 | 
			
		||||
        >
 | 
			
		||||
    LIST_SEPARATOR ::
 | 
			
		||||
    TEST_COMMAND ""
 | 
			
		||||
    INSTALL_COMMAND ""
 | 
			
		||||
    DEPENDS snappy_lib lz4_lib
 | 
			
		||||
    BUILD_BYPRODUCTS
 | 
			
		||||
      <BINARY_DIR>/${ep_lib_prefix}rocksdb${ep_lib_suffix}
 | 
			
		||||
      <BINARY_DIR>/${ep_lib_prefix}rocksdb_d${ep_lib_suffix}
 | 
			
		||||
  )
 | 
			
		||||
  ExternalProject_Get_Property (rocksdb BINARY_DIR)
 | 
			
		||||
  ExternalProject_Get_Property (rocksdb SOURCE_DIR)
 | 
			
		||||
  if (CMAKE_VERBOSE_MAKEFILE)
 | 
			
		||||
    print_ep_logs (rocksdb)
 | 
			
		||||
  endif ()
 | 
			
		||||
  file (MAKE_DIRECTORY ${SOURCE_DIR}/include)
 | 
			
		||||
  set_target_properties (rocksdb_lib PROPERTIES
 | 
			
		||||
    IMPORTED_LOCATION_DEBUG
 | 
			
		||||
      ${BINARY_DIR}/${ep_lib_prefix}rocksdb_d${ep_lib_suffix}
 | 
			
		||||
    IMPORTED_LOCATION_RELEASE
 | 
			
		||||
      ${BINARY_DIR}/${ep_lib_prefix}rocksdb${ep_lib_suffix}
 | 
			
		||||
    INTERFACE_INCLUDE_DIRECTORIES
 | 
			
		||||
      ${SOURCE_DIR}/include
 | 
			
		||||
    INTERFACE_COMPILE_DEFINITIONS
 | 
			
		||||
      RIPPLE_ROCKSDB_AVAILABLE=1)
 | 
			
		||||
  add_dependencies (rocksdb_lib rocksdb)
 | 
			
		||||
  target_link_libraries (rocksdb_lib INTERFACE snappy_lib lz4_lib)
 | 
			
		||||
  if (MSVC)
 | 
			
		||||
    target_link_libraries (rocksdb_lib INTERFACE rpcrt4)
 | 
			
		||||
  endif ()
 | 
			
		||||
  target_link_libraries (ripple_libs INTERFACE rocksdb_lib)
 | 
			
		||||
  exclude_if_included (rocksdb)
 | 
			
		||||
  exclude_if_included (rocksdb_lib)
 | 
			
		||||
endif ()
 | 
			
		||||
add_library (rocksdb_lib STATIC IMPORTED GLOBAL)
 | 
			
		||||
file (MAKE_DIRECTORY ${SOURCE_DIR}/include)
 | 
			
		||||
set_target_properties (rocksdb_lib PROPERTIES
 | 
			
		||||
  IMPORTED_LOCATION_DEBUG
 | 
			
		||||
    ${BINARY_DIR}/${ep_lib_prefix}rocksdb_d${ep_lib_suffix}
 | 
			
		||||
  IMPORTED_LOCATION_RELEASE
 | 
			
		||||
    ${BINARY_DIR}/${ep_lib_prefix}rocksdb${ep_lib_suffix}
 | 
			
		||||
  INTERFACE_INCLUDE_DIRECTORIES
 | 
			
		||||
    ${SOURCE_DIR}/include
 | 
			
		||||
  INTERFACE_COMPILE_DEFINITIONS
 | 
			
		||||
    RIPPLE_ROCKSDB_AVAILABLE=1)
 | 
			
		||||
add_dependencies (rocksdb_lib rocksdb)
 | 
			
		||||
target_link_libraries (rocksdb_lib INTERFACE snappy_lib lz4_lib)
 | 
			
		||||
if (MSVC)
 | 
			
		||||
  target_link_libraries (rocksdb_lib INTERFACE rpcrt4)
 | 
			
		||||
endif ()
 | 
			
		||||
target_link_libraries (ripple_libs INTERFACE rocksdb_lib)
 | 
			
		||||
exclude_if_included (rocksdb)
 | 
			
		||||
exclude_if_included (rocksdb_lib)
 | 
			
		||||
 
 | 
			
		||||
@@ -8,7 +8,6 @@ if (NOT WIN32)
 | 
			
		||||
  find_package(secp256k1)
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
if(secp256k1)
 | 
			
		||||
  set_target_properties (secp256k1_lib PROPERTIES
 | 
			
		||||
    IMPORTED_LOCATION_DEBUG
 | 
			
		||||
 
 | 
			
		||||
@@ -31,6 +31,14 @@ else()
 | 
			
		||||
    set (soci_lib_post "_4_0")
 | 
			
		||||
  endif ()
 | 
			
		||||
  get_target_property (_boost_incs Boost::date_time INTERFACE_INCLUDE_DIRECTORIES)
 | 
			
		||||
  get_target_property (_boost_dt Boost::date_time IMPORTED_LOCATION)
 | 
			
		||||
  if (NOT _boost_dt)
 | 
			
		||||
    get_target_property (_boost_dt Boost::date_time IMPORTED_LOCATION_RELEASE)
 | 
			
		||||
  endif ()
 | 
			
		||||
  if (NOT _boost_dt)
 | 
			
		||||
    get_target_property (_boost_dt Boost::date_time IMPORTED_LOCATION_DEBUG)
 | 
			
		||||
  endif ()
 | 
			
		||||
 | 
			
		||||
  ExternalProject_Add (soci
 | 
			
		||||
    PREFIX ${nih_cache_path}
 | 
			
		||||
    GIT_REPOSITORY https://github.com/SOCI/soci.git
 | 
			
		||||
@@ -59,13 +67,18 @@ else()
 | 
			
		||||
      -DSOCI_LIBDIR=lib
 | 
			
		||||
      -DSOCI_SHARED=OFF
 | 
			
		||||
      -DSOCI_TESTS=OFF
 | 
			
		||||
      # hack to workaround the fact that soci doesn't currently use
 | 
			
		||||
      # hacks to workaround the fact that soci doesn't currently use
 | 
			
		||||
      # boost imported targets in its cmake. If they switch to
 | 
			
		||||
      # proper imported targets, this next line can be removed
 | 
			
		||||
      # (as well as the get_property above that sets _boost_incs)
 | 
			
		||||
      -DBoost_INCLUDE_DIRS=$<JOIN:${_boost_incs},::>
 | 
			
		||||
      -DBOOST_ROOT=${BOOST_ROOT}
 | 
			
		||||
      -DWITH_BOOST=ON
 | 
			
		||||
      -DBoost_FOUND=ON
 | 
			
		||||
      -DBoost_DATE_TIME_FOUND=ON
 | 
			
		||||
      -DSOCI_HAVE_BOOST=ON
 | 
			
		||||
      -DSOCI_HAVE_BOOST_DATE_TIME=ON
 | 
			
		||||
      -DBoost_DATE_TIME_LIBRARY=${_boost_dt}
 | 
			
		||||
      -DSOCI_DB2=OFF
 | 
			
		||||
      -DSOCI_FIREBIRD=OFF
 | 
			
		||||
      -DSOCI_MYSQL=OFF
 | 
			
		||||
 
 | 
			
		||||
@@ -13,14 +13,14 @@ if (NOT TARGET date::date)
 | 
			
		||||
    FetchContent_Declare(
 | 
			
		||||
      hh_date_src
 | 
			
		||||
      GIT_REPOSITORY https://github.com/HowardHinnant/date.git
 | 
			
		||||
      GIT_TAG        48f1455cd255df2fe73b5f293b47203ad0988199
 | 
			
		||||
      GIT_TAG        fc4cf092f9674f2670fb9177edcdee870399b829
 | 
			
		||||
    )
 | 
			
		||||
    FetchContent_MakeAvailable(hh_date_src)
 | 
			
		||||
  else ()
 | 
			
		||||
    ExternalProject_Add (hh_date_src
 | 
			
		||||
      PREFIX ${nih_cache_path}
 | 
			
		||||
      GIT_REPOSITORY https://github.com/HowardHinnant/date.git
 | 
			
		||||
      GIT_TAG        48f1455cd255df2fe73b5f293b47203ad0988199
 | 
			
		||||
      GIT_TAG        fc4cf092f9674f2670fb9177edcdee870399b829
 | 
			
		||||
      CONFIGURE_COMMAND ""
 | 
			
		||||
      BUILD_COMMAND ""
 | 
			
		||||
      TEST_COMMAND ""
 | 
			
		||||
 
 | 
			
		||||
@@ -8,146 +8,100 @@ else ()
 | 
			
		||||
  set (grpc_suffix "_unsecure")
 | 
			
		||||
endif ()
 | 
			
		||||
 | 
			
		||||
find_package (PkgConfig QUIET)
 | 
			
		||||
if (PKG_CONFIG_FOUND)
 | 
			
		||||
  pkg_check_modules (grpc QUIET "grpc${grpc_suffix}>=1.25" "grpc++${grpc_suffix}" gpr)
 | 
			
		||||
endif ()
 | 
			
		||||
find_package (gRPC 1.23 CONFIG QUIET)
 | 
			
		||||
if (TARGET gRPC::gpr)
 | 
			
		||||
  get_target_property (_grpc_l gRPC::gpr IMPORTED_LOCATION_DEBUG)
 | 
			
		||||
  if (NOT _grpc_l)
 | 
			
		||||
    get_target_property (_grpc_l gRPC::gpr IMPORTED_LOCATION_RELEASE)
 | 
			
		||||
  endif ()
 | 
			
		||||
  if (NOT _grpc_l)
 | 
			
		||||
    get_target_property (_grpc_l gRPC::gpr IMPORTED_LOCATION)
 | 
			
		||||
  endif ()
 | 
			
		||||
  message (STATUS "Found cmake config for gRPC. Using ${_grpc_l}.")
 | 
			
		||||
else ()
 | 
			
		||||
  find_package (PkgConfig QUIET)
 | 
			
		||||
  if (PKG_CONFIG_FOUND)
 | 
			
		||||
    pkg_check_modules (grpc QUIET "grpc${grpc_suffix}>=1.25" "grpc++${grpc_suffix}" gpr)
 | 
			
		||||
  endif ()
 | 
			
		||||
 | 
			
		||||
if (grpc_FOUND)
 | 
			
		||||
  message (STATUS "Found gRPC using pkg-config. Using ${grpc_gpr_PREFIX}.")
 | 
			
		||||
endif ()
 | 
			
		||||
  if (grpc_FOUND)
 | 
			
		||||
    message (STATUS "Found gRPC using pkg-config. Using ${grpc_gpr_PREFIX}.")
 | 
			
		||||
  endif ()
 | 
			
		||||
 | 
			
		||||
add_executable (gRPC::grpc_cpp_plugin IMPORTED)
 | 
			
		||||
exclude_if_included (gRPC::grpc_cpp_plugin)
 | 
			
		||||
  add_executable (gRPC::grpc_cpp_plugin IMPORTED)
 | 
			
		||||
  exclude_if_included (gRPC::grpc_cpp_plugin)
 | 
			
		||||
 | 
			
		||||
if (grpc_FOUND AND NOT local_grpc)
 | 
			
		||||
  # use installed grpc (via pkg-config)
 | 
			
		||||
  macro (add_imported_grpc libname_)
 | 
			
		||||
    if (static)
 | 
			
		||||
      set (_search "${CMAKE_STATIC_LIBRARY_PREFIX}${libname_}${CMAKE_STATIC_LIBRARY_SUFFIX}")
 | 
			
		||||
  if (grpc_FOUND AND NOT local_grpc)
 | 
			
		||||
    # use installed grpc (via pkg-config)
 | 
			
		||||
    macro (add_imported_grpc libname_)
 | 
			
		||||
      if (static)
 | 
			
		||||
        set (_search "${CMAKE_STATIC_LIBRARY_PREFIX}${libname_}${CMAKE_STATIC_LIBRARY_SUFFIX}")
 | 
			
		||||
      else ()
 | 
			
		||||
        set (_search "${CMAKE_SHARED_LIBRARY_PREFIX}${libname_}${CMAKE_SHARED_LIBRARY_SUFFIX}")
 | 
			
		||||
      endif()
 | 
			
		||||
      find_library(_found_${libname_}
 | 
			
		||||
        NAMES ${_search}
 | 
			
		||||
        HINTS ${grpc_LIBRARY_DIRS})
 | 
			
		||||
      if (_found_${libname_})
 | 
			
		||||
        message (STATUS "importing ${libname_} as ${_found_${libname_}}")
 | 
			
		||||
      else ()
 | 
			
		||||
        message (FATAL_ERROR "using pkg-config for grpc, can't find ${_search}")
 | 
			
		||||
      endif ()
 | 
			
		||||
      add_library ("gRPC::${libname_}" STATIC IMPORTED GLOBAL)
 | 
			
		||||
      set_target_properties ("gRPC::${libname_}" PROPERTIES IMPORTED_LOCATION ${_found_${libname_}})
 | 
			
		||||
      if (grpc_INCLUDE_DIRS)
 | 
			
		||||
        set_target_properties ("gRPC::${libname_}" PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${grpc_INCLUDE_DIRS})
 | 
			
		||||
      endif ()
 | 
			
		||||
      target_link_libraries (ripple_libs INTERFACE "gRPC::${libname_}")
 | 
			
		||||
      exclude_if_included ("gRPC::${libname_}")
 | 
			
		||||
    endmacro ()
 | 
			
		||||
 | 
			
		||||
    set_target_properties (gRPC::grpc_cpp_plugin PROPERTIES
 | 
			
		||||
        IMPORTED_LOCATION "${grpc_gpr_PREFIX}/bin/grpc_cpp_plugin${CMAKE_EXECUTABLE_SUFFIX}")
 | 
			
		||||
 | 
			
		||||
    pkg_check_modules (cares QUIET libcares)
 | 
			
		||||
    if (cares_FOUND)
 | 
			
		||||
      if (static)
 | 
			
		||||
        set (_search "${CMAKE_STATIC_LIBRARY_PREFIX}cares${CMAKE_STATIC_LIBRARY_SUFFIX}")
 | 
			
		||||
      else ()
 | 
			
		||||
        set (_search "${CMAKE_SHARED_LIBRARY_PREFIX}cares${CMAKE_SHARED_LIBRARY_SUFFIX}")
 | 
			
		||||
      endif()
 | 
			
		||||
      find_library(_cares
 | 
			
		||||
        NAMES ${_search}
 | 
			
		||||
        HINTS ${cares_LIBRARY_DIRS})
 | 
			
		||||
      if (NOT _cares)
 | 
			
		||||
        message (FATAL_ERROR "using pkg-config for grpc, can't find c-ares")
 | 
			
		||||
      endif ()
 | 
			
		||||
      add_library (c-ares::cares STATIC IMPORTED GLOBAL)
 | 
			
		||||
      set_target_properties (c-ares::cares PROPERTIES IMPORTED_LOCATION ${_cares})
 | 
			
		||||
      if (cares_INCLUDE_DIRS)
 | 
			
		||||
        set_target_properties (c-ares::cares PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${cares_INCLUDE_DIRS})
 | 
			
		||||
      endif ()
 | 
			
		||||
      exclude_if_included (c-ares::cares)
 | 
			
		||||
    else ()
 | 
			
		||||
      set (_search "${CMAKE_SHARED_LIBRARY_PREFIX}${libname_}${CMAKE_SHARED_LIBRARY_SUFFIX}")
 | 
			
		||||
    endif()
 | 
			
		||||
    find_library(_found_${libname_}
 | 
			
		||||
      NAMES ${_search}
 | 
			
		||||
      HINTS ${grpc_LIBRARY_DIRS})
 | 
			
		||||
    if (_found_${libname_})
 | 
			
		||||
      message (STATUS "importing ${libname_} as ${_found_${libname_}}")
 | 
			
		||||
    else ()
 | 
			
		||||
      message (FATAL_ERROR "using pkg-config for grpc, can't find ${_search}")
 | 
			
		||||
    endif ()
 | 
			
		||||
    add_library ("gRPC::${libname_}" STATIC IMPORTED GLOBAL)
 | 
			
		||||
    set_target_properties ("gRPC::${libname_}" PROPERTIES IMPORTED_LOCATION ${_found_${libname_}})
 | 
			
		||||
    if (grpc_INCLUDE_DIRS)
 | 
			
		||||
      set_target_properties ("gRPC::${libname_}" PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${grpc_INCLUDE_DIRS})
 | 
			
		||||
    endif ()
 | 
			
		||||
    target_link_libraries (ripple_libs INTERFACE "gRPC::${libname_}")
 | 
			
		||||
    exclude_if_included ("gRPC::${libname_}")
 | 
			
		||||
  endmacro ()
 | 
			
		||||
 | 
			
		||||
  set_target_properties (gRPC::grpc_cpp_plugin PROPERTIES
 | 
			
		||||
      IMPORTED_LOCATION "${grpc_gpr_PREFIX}/bin/grpc_cpp_plugin${CMAKE_EXECUTABLE_SUFFIX}")
 | 
			
		||||
 | 
			
		||||
  pkg_check_modules (cares QUIET libcares)
 | 
			
		||||
  if (cares_FOUND)
 | 
			
		||||
    if (static)
 | 
			
		||||
      set (_search "${CMAKE_STATIC_LIBRARY_PREFIX}cares${CMAKE_STATIC_LIBRARY_SUFFIX}")
 | 
			
		||||
    else ()
 | 
			
		||||
      set (_search "${CMAKE_SHARED_LIBRARY_PREFIX}cares${CMAKE_SHARED_LIBRARY_SUFFIX}")
 | 
			
		||||
    endif()
 | 
			
		||||
    find_library(_cares
 | 
			
		||||
      NAMES ${_search}
 | 
			
		||||
      HINTS ${cares_LIBRARY_DIRS})
 | 
			
		||||
    if (NOT _cares)
 | 
			
		||||
      message (FATAL_ERROR "using pkg-config for grpc, can't find c-ares")
 | 
			
		||||
    endif ()
 | 
			
		||||
    add_library (c-ares::cares STATIC IMPORTED GLOBAL)
 | 
			
		||||
    set_target_properties (c-ares::cares PROPERTIES IMPORTED_LOCATION ${_cares})
 | 
			
		||||
    if (cares_INCLUDE_DIRS)
 | 
			
		||||
      set_target_properties (c-ares::cares PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${cares_INCLUDE_DIRS})
 | 
			
		||||
    endif ()
 | 
			
		||||
    exclude_if_included (c-ares::cares)
 | 
			
		||||
  else ()
 | 
			
		||||
    message (FATAL_ERROR "using pkg-config for grpc, can't find c-ares")
 | 
			
		||||
  endif ()
 | 
			
		||||
else ()
 | 
			
		||||
  #[===========================[
 | 
			
		||||
     c-ares (grpc requires)
 | 
			
		||||
  #]===========================]
 | 
			
		||||
  ExternalProject_Add (c-ares_src
 | 
			
		||||
    PREFIX ${nih_cache_path}
 | 
			
		||||
    GIT_REPOSITORY https://github.com/c-ares/c-ares.git
 | 
			
		||||
    GIT_TAG cares-1_15_0
 | 
			
		||||
    CMAKE_ARGS
 | 
			
		||||
      -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
 | 
			
		||||
      $<$<BOOL:${CMAKE_VERBOSE_MAKEFILE}>:-DCMAKE_VERBOSE_MAKEFILE=ON>
 | 
			
		||||
      -DCMAKE_DEBUG_POSTFIX=_d
 | 
			
		||||
      $<$<NOT:$<BOOL:${is_multiconfig}>>:-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}>
 | 
			
		||||
      -DCMAKE_INSTALL_PREFIX=<BINARY_DIR>/_installed_
 | 
			
		||||
      -DCARES_SHARED=OFF
 | 
			
		||||
      -DCARES_STATIC=ON
 | 
			
		||||
      -DCARES_STATIC_PIC=ON
 | 
			
		||||
      -DCARES_INSTALL=ON
 | 
			
		||||
      -DCARES_MSVC_STATIC_RUNTIME=ON
 | 
			
		||||
      $<$<BOOL:${MSVC}>:
 | 
			
		||||
        "-DCMAKE_C_FLAGS=-GR -Gd -fp:precise -FS -MP"
 | 
			
		||||
      >
 | 
			
		||||
    LOG_BUILD ON
 | 
			
		||||
    LOG_CONFIGURE ON
 | 
			
		||||
    BUILD_COMMAND
 | 
			
		||||
      ${CMAKE_COMMAND}
 | 
			
		||||
        --build .
 | 
			
		||||
        --config $<CONFIG>
 | 
			
		||||
        $<$<VERSION_GREATER_EQUAL:${CMAKE_VERSION},3.12>:--parallel ${ep_procs}>
 | 
			
		||||
    TEST_COMMAND ""
 | 
			
		||||
    INSTALL_COMMAND
 | 
			
		||||
      ${CMAKE_COMMAND} -E env --unset=DESTDIR ${CMAKE_COMMAND} --build . --config $<CONFIG> --target install
 | 
			
		||||
    BUILD_BYPRODUCTS
 | 
			
		||||
      <BINARY_DIR>/_installed_/lib/${ep_lib_prefix}cares${ep_lib_suffix}
 | 
			
		||||
      <BINARY_DIR>/_installed_/lib/${ep_lib_prefix}cares_d${ep_lib_suffix}
 | 
			
		||||
  )
 | 
			
		||||
  exclude_if_included (c-ares_src)
 | 
			
		||||
  ExternalProject_Get_Property (c-ares_src BINARY_DIR)
 | 
			
		||||
  set (cares_binary_dir "${BINARY_DIR}")
 | 
			
		||||
 | 
			
		||||
  add_library (c-ares::cares STATIC IMPORTED GLOBAL)
 | 
			
		||||
  file (MAKE_DIRECTORY ${BINARY_DIR}/_installed_/include)
 | 
			
		||||
  set_target_properties (c-ares::cares PROPERTIES
 | 
			
		||||
    IMPORTED_LOCATION_DEBUG
 | 
			
		||||
      ${BINARY_DIR}/_installed_/lib/${ep_lib_prefix}cares_d${ep_lib_suffix}
 | 
			
		||||
    IMPORTED_LOCATION_RELEASE
 | 
			
		||||
      ${BINARY_DIR}/_installed_/lib/${ep_lib_prefix}cares${ep_lib_suffix}
 | 
			
		||||
    INTERFACE_INCLUDE_DIRECTORIES
 | 
			
		||||
      ${BINARY_DIR}/_installed_/include)
 | 
			
		||||
  add_dependencies (c-ares::cares c-ares_src)
 | 
			
		||||
  exclude_if_included (c-ares::cares)
 | 
			
		||||
 | 
			
		||||
  if (NOT has_zlib)
 | 
			
		||||
    #[===========================[
 | 
			
		||||
       zlib (grpc requires)
 | 
			
		||||
       c-ares (grpc requires)
 | 
			
		||||
    #]===========================]
 | 
			
		||||
    if (MSVC)
 | 
			
		||||
      set (zlib_debug_postfix "d") # zlib cmake sets this internally for MSVC, so we really don't have a choice
 | 
			
		||||
      set (zlib_base "zlibstatic")
 | 
			
		||||
    else ()
 | 
			
		||||
      set (zlib_debug_postfix "_d")
 | 
			
		||||
      set (zlib_base "z")
 | 
			
		||||
    endif ()
 | 
			
		||||
    ExternalProject_Add (zlib_src
 | 
			
		||||
    ExternalProject_Add (c-ares_src
 | 
			
		||||
      PREFIX ${nih_cache_path}
 | 
			
		||||
      GIT_REPOSITORY https://github.com/madler/zlib.git
 | 
			
		||||
      GIT_TAG v1.2.11
 | 
			
		||||
      GIT_REPOSITORY https://github.com/c-ares/c-ares.git
 | 
			
		||||
      GIT_TAG cares-1_15_0
 | 
			
		||||
      CMAKE_ARGS
 | 
			
		||||
        -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
 | 
			
		||||
        $<$<BOOL:${CMAKE_VERBOSE_MAKEFILE}>:-DCMAKE_VERBOSE_MAKEFILE=ON>
 | 
			
		||||
        -DCMAKE_DEBUG_POSTFIX=${zlib_debug_postfix}
 | 
			
		||||
        -DCMAKE_DEBUG_POSTFIX=_d
 | 
			
		||||
        $<$<NOT:$<BOOL:${is_multiconfig}>>:-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}>
 | 
			
		||||
        -DCMAKE_INSTALL_PREFIX=<BINARY_DIR>/_installed_
 | 
			
		||||
        -DBUILD_SHARED_LIBS=OFF
 | 
			
		||||
        -DCARES_SHARED=OFF
 | 
			
		||||
        -DCARES_STATIC=ON
 | 
			
		||||
        -DCARES_STATIC_PIC=ON
 | 
			
		||||
        -DCARES_INSTALL=ON
 | 
			
		||||
        -DCARES_MSVC_STATIC_RUNTIME=ON
 | 
			
		||||
        $<$<BOOL:${MSVC}>:
 | 
			
		||||
          "-DCMAKE_C_FLAGS=-GR -Gd -fp:precise -FS -MP"
 | 
			
		||||
          "-DCMAKE_C_FLAGS_DEBUG=-MTd"
 | 
			
		||||
          "-DCMAKE_C_FLAGS_RELEASE=-MT"
 | 
			
		||||
        >
 | 
			
		||||
      LOG_BUILD ON
 | 
			
		||||
      LOG_CONFIGURE ON
 | 
			
		||||
@@ -160,133 +114,191 @@ else ()
 | 
			
		||||
      INSTALL_COMMAND
 | 
			
		||||
        ${CMAKE_COMMAND} -E env --unset=DESTDIR ${CMAKE_COMMAND} --build . --config $<CONFIG> --target install
 | 
			
		||||
      BUILD_BYPRODUCTS
 | 
			
		||||
        <BINARY_DIR>/_installed_/lib/${ep_lib_prefix}${zlib_base}${ep_lib_suffix}
 | 
			
		||||
        <BINARY_DIR>/_installed_/lib/${ep_lib_prefix}${zlib_base}${zlib_debug_postfix}${ep_lib_suffix}
 | 
			
		||||
        <BINARY_DIR>/_installed_/lib/${ep_lib_prefix}cares${ep_lib_suffix}
 | 
			
		||||
        <BINARY_DIR>/_installed_/lib/${ep_lib_prefix}cares_d${ep_lib_suffix}
 | 
			
		||||
    )
 | 
			
		||||
    exclude_if_included (zlib_src)
 | 
			
		||||
    ExternalProject_Get_Property (zlib_src BINARY_DIR)
 | 
			
		||||
    set (zlib_binary_dir "${BINARY_DIR}")
 | 
			
		||||
    exclude_if_included (c-ares_src)
 | 
			
		||||
    ExternalProject_Get_Property (c-ares_src BINARY_DIR)
 | 
			
		||||
    set (cares_binary_dir "${BINARY_DIR}")
 | 
			
		||||
 | 
			
		||||
    add_library (ZLIB::ZLIB STATIC IMPORTED GLOBAL)
 | 
			
		||||
    add_library (c-ares::cares STATIC IMPORTED GLOBAL)
 | 
			
		||||
    file (MAKE_DIRECTORY ${BINARY_DIR}/_installed_/include)
 | 
			
		||||
    set_target_properties (ZLIB::ZLIB PROPERTIES
 | 
			
		||||
    set_target_properties (c-ares::cares PROPERTIES
 | 
			
		||||
      IMPORTED_LOCATION_DEBUG
 | 
			
		||||
        ${BINARY_DIR}/_installed_/lib/${ep_lib_prefix}${zlib_base}${zlib_debug_postfix}${ep_lib_suffix}
 | 
			
		||||
        ${BINARY_DIR}/_installed_/lib/${ep_lib_prefix}cares_d${ep_lib_suffix}
 | 
			
		||||
      IMPORTED_LOCATION_RELEASE
 | 
			
		||||
        ${BINARY_DIR}/_installed_/lib/${ep_lib_prefix}${zlib_base}${ep_lib_suffix}
 | 
			
		||||
        ${BINARY_DIR}/_installed_/lib/${ep_lib_prefix}cares${ep_lib_suffix}
 | 
			
		||||
      INTERFACE_INCLUDE_DIRECTORIES
 | 
			
		||||
        ${BINARY_DIR}/_installed_/include)
 | 
			
		||||
    add_dependencies (ZLIB::ZLIB zlib_src)
 | 
			
		||||
    exclude_if_included (ZLIB::ZLIB)
 | 
			
		||||
  endif ()
 | 
			
		||||
    add_dependencies (c-ares::cares c-ares_src)
 | 
			
		||||
    exclude_if_included (c-ares::cares)
 | 
			
		||||
 | 
			
		||||
  #[===========================[
 | 
			
		||||
     grpc
 | 
			
		||||
  #]===========================]
 | 
			
		||||
  ExternalProject_Add (grpc_src
 | 
			
		||||
    PREFIX ${nih_cache_path}
 | 
			
		||||
    GIT_REPOSITORY https://github.com/grpc/grpc.git
 | 
			
		||||
    GIT_TAG v1.25.0
 | 
			
		||||
    CMAKE_ARGS
 | 
			
		||||
      -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
 | 
			
		||||
      -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
 | 
			
		||||
      $<$<BOOL:${CMAKE_VERBOSE_MAKEFILE}>:-DCMAKE_VERBOSE_MAKEFILE=ON>
 | 
			
		||||
      $<$<BOOL:${CMAKE_TOOLCHAIN_FILE}>:-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}>
 | 
			
		||||
      $<$<BOOL:${VCPKG_TARGET_TRIPLET}>:-DVCPKG_TARGET_TRIPLET=${VCPKG_TARGET_TRIPLET}>
 | 
			
		||||
      -DCMAKE_DEBUG_POSTFIX=_d
 | 
			
		||||
      $<$<NOT:$<BOOL:${is_multiconfig}>>:-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}>
 | 
			
		||||
      -DgRPC_BUILD_TESTS=OFF
 | 
			
		||||
      -DgRPC_BUILD_CSHARP_EXT=OFF
 | 
			
		||||
      -DgRPC_MSVC_STATIC_RUNTIME=ON
 | 
			
		||||
      -DgRPC_INSTALL=OFF
 | 
			
		||||
      -DgRPC_CARES_PROVIDER=package
 | 
			
		||||
      -Dc-ares_DIR=${cares_binary_dir}/_installed_/lib/cmake/c-ares
 | 
			
		||||
      -DgRPC_SSL_PROVIDER=package
 | 
			
		||||
      -DOPENSSL_ROOT_DIR=${OPENSSL_ROOT_DIR}
 | 
			
		||||
      -DgRPC_PROTOBUF_PROVIDER=package
 | 
			
		||||
      -DProtobuf_USE_STATIC_LIBS=$<IF:$<AND:$<BOOL:${Protobuf_FOUND}>,$<NOT:$<BOOL:${static}>>>,OFF,ON>
 | 
			
		||||
      -DProtobuf_INCLUDE_DIR=$<JOIN:$<TARGET_PROPERTY:protobuf::libprotobuf,INTERFACE_INCLUDE_DIRECTORIES>,:_:>
 | 
			
		||||
      -DProtobuf_LIBRARY=$<IF:$<CONFIG:Debug>,$<TARGET_PROPERTY:protobuf::libprotobuf,IMPORTED_LOCATION_DEBUG>,$<TARGET_PROPERTY:protobuf::libprotobuf,IMPORTED_LOCATION_RELEASE>>
 | 
			
		||||
      -DProtobuf_PROTOC_LIBRARY=$<IF:$<CONFIG:Debug>,$<TARGET_PROPERTY:protobuf::libprotoc,IMPORTED_LOCATION_DEBUG>,$<TARGET_PROPERTY:protobuf::libprotoc,IMPORTED_LOCATION_RELEASE>>
 | 
			
		||||
      -DProtobuf_PROTOC_EXECUTABLE=$<TARGET_PROPERTY:protobuf::protoc,IMPORTED_LOCATION>
 | 
			
		||||
      -DgRPC_ZLIB_PROVIDER=package
 | 
			
		||||
      $<$<NOT:$<BOOL:${has_zlib}>>:-DZLIB_ROOT=${zlib_binary_dir}/_installed_>
 | 
			
		||||
      $<$<BOOL:${MSVC}>:
 | 
			
		||||
        "-DCMAKE_CXX_FLAGS=-GR -Gd -fp:precise -FS -EHa -MP"
 | 
			
		||||
        "-DCMAKE_C_FLAGS=-GR -Gd -fp:precise -FS -MP"
 | 
			
		||||
      >
 | 
			
		||||
    LOG_BUILD ON
 | 
			
		||||
    LOG_CONFIGURE ON
 | 
			
		||||
    BUILD_COMMAND
 | 
			
		||||
      ${CMAKE_COMMAND}
 | 
			
		||||
      --build .
 | 
			
		||||
      --config $<CONFIG>
 | 
			
		||||
      $<$<VERSION_GREATER_EQUAL:${CMAKE_VERSION},3.12>:--parallel ${ep_procs}>
 | 
			
		||||
      $<$<BOOL:${is_multiconfig}>:
 | 
			
		||||
        COMMAND
 | 
			
		||||
          ${CMAKE_COMMAND} -E copy
 | 
			
		||||
          <BINARY_DIR>/$<CONFIG>/${ep_lib_prefix}grpc${grpc_suffix}$<$<CONFIG:Debug>:_d>${ep_lib_suffix}
 | 
			
		||||
          <BINARY_DIR>/$<CONFIG>/${ep_lib_prefix}grpc++${grpc_suffix}$<$<CONFIG:Debug>:_d>${ep_lib_suffix}
 | 
			
		||||
          <BINARY_DIR>/$<CONFIG>/${ep_lib_prefix}address_sorting$<$<CONFIG:Debug>:_d>${ep_lib_suffix}
 | 
			
		||||
          <BINARY_DIR>/$<CONFIG>/${ep_lib_prefix}gpr$<$<CONFIG:Debug>:_d>${ep_lib_suffix}
 | 
			
		||||
          <BINARY_DIR>/$<CONFIG>/grpc_cpp_plugin${CMAKE_EXECUTABLE_SUFFIX}
 | 
			
		||||
          <BINARY_DIR>
 | 
			
		||||
    if (NOT has_zlib)
 | 
			
		||||
      #[===========================[
 | 
			
		||||
         zlib (grpc requires)
 | 
			
		||||
      #]===========================]
 | 
			
		||||
      if (MSVC)
 | 
			
		||||
        set (zlib_debug_postfix "d") # zlib cmake sets this internally for MSVC, so we really don't have a choice
 | 
			
		||||
        set (zlib_base "zlibstatic")
 | 
			
		||||
      else ()
 | 
			
		||||
        set (zlib_debug_postfix "_d")
 | 
			
		||||
        set (zlib_base "z")
 | 
			
		||||
      endif ()
 | 
			
		||||
      ExternalProject_Add (zlib_src
 | 
			
		||||
        PREFIX ${nih_cache_path}
 | 
			
		||||
        GIT_REPOSITORY https://github.com/madler/zlib.git
 | 
			
		||||
        GIT_TAG v1.2.11
 | 
			
		||||
        CMAKE_ARGS
 | 
			
		||||
          -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
 | 
			
		||||
          $<$<BOOL:${CMAKE_VERBOSE_MAKEFILE}>:-DCMAKE_VERBOSE_MAKEFILE=ON>
 | 
			
		||||
          -DCMAKE_DEBUG_POSTFIX=${zlib_debug_postfix}
 | 
			
		||||
          $<$<NOT:$<BOOL:${is_multiconfig}>>:-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}>
 | 
			
		||||
          -DCMAKE_INSTALL_PREFIX=<BINARY_DIR>/_installed_
 | 
			
		||||
          -DBUILD_SHARED_LIBS=OFF
 | 
			
		||||
          $<$<BOOL:${MSVC}>:
 | 
			
		||||
            "-DCMAKE_C_FLAGS=-GR -Gd -fp:precise -FS -MP"
 | 
			
		||||
            "-DCMAKE_C_FLAGS_DEBUG=-MTd"
 | 
			
		||||
            "-DCMAKE_C_FLAGS_RELEASE=-MT"
 | 
			
		||||
          >
 | 
			
		||||
        LOG_BUILD ON
 | 
			
		||||
        LOG_CONFIGURE ON
 | 
			
		||||
        BUILD_COMMAND
 | 
			
		||||
          ${CMAKE_COMMAND}
 | 
			
		||||
            --build .
 | 
			
		||||
            --config $<CONFIG>
 | 
			
		||||
            $<$<VERSION_GREATER_EQUAL:${CMAKE_VERSION},3.12>:--parallel ${ep_procs}>
 | 
			
		||||
        TEST_COMMAND ""
 | 
			
		||||
        INSTALL_COMMAND
 | 
			
		||||
          ${CMAKE_COMMAND} -E env --unset=DESTDIR ${CMAKE_COMMAND} --build . --config $<CONFIG> --target install
 | 
			
		||||
        BUILD_BYPRODUCTS
 | 
			
		||||
          <BINARY_DIR>/_installed_/lib/${ep_lib_prefix}${zlib_base}${ep_lib_suffix}
 | 
			
		||||
          <BINARY_DIR>/_installed_/lib/${ep_lib_prefix}${zlib_base}${zlib_debug_postfix}${ep_lib_suffix}
 | 
			
		||||
      )
 | 
			
		||||
      exclude_if_included (zlib_src)
 | 
			
		||||
      ExternalProject_Get_Property (zlib_src BINARY_DIR)
 | 
			
		||||
      set (zlib_binary_dir "${BINARY_DIR}")
 | 
			
		||||
 | 
			
		||||
      add_library (ZLIB::ZLIB STATIC IMPORTED GLOBAL)
 | 
			
		||||
      file (MAKE_DIRECTORY ${BINARY_DIR}/_installed_/include)
 | 
			
		||||
      set_target_properties (ZLIB::ZLIB PROPERTIES
 | 
			
		||||
        IMPORTED_LOCATION_DEBUG
 | 
			
		||||
          ${BINARY_DIR}/_installed_/lib/${ep_lib_prefix}${zlib_base}${zlib_debug_postfix}${ep_lib_suffix}
 | 
			
		||||
        IMPORTED_LOCATION_RELEASE
 | 
			
		||||
          ${BINARY_DIR}/_installed_/lib/${ep_lib_prefix}${zlib_base}${ep_lib_suffix}
 | 
			
		||||
        INTERFACE_INCLUDE_DIRECTORIES
 | 
			
		||||
          ${BINARY_DIR}/_installed_/include)
 | 
			
		||||
      add_dependencies (ZLIB::ZLIB zlib_src)
 | 
			
		||||
      exclude_if_included (ZLIB::ZLIB)
 | 
			
		||||
    endif ()
 | 
			
		||||
 | 
			
		||||
    #[===========================[
 | 
			
		||||
       grpc
 | 
			
		||||
    #]===========================]
 | 
			
		||||
    ExternalProject_Add (grpc_src
 | 
			
		||||
      PREFIX ${nih_cache_path}
 | 
			
		||||
      GIT_REPOSITORY https://github.com/grpc/grpc.git
 | 
			
		||||
      GIT_TAG v1.25.0
 | 
			
		||||
      CMAKE_ARGS
 | 
			
		||||
        -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
 | 
			
		||||
        -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
 | 
			
		||||
        $<$<BOOL:${CMAKE_VERBOSE_MAKEFILE}>:-DCMAKE_VERBOSE_MAKEFILE=ON>
 | 
			
		||||
        $<$<BOOL:${CMAKE_TOOLCHAIN_FILE}>:-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}>
 | 
			
		||||
        $<$<BOOL:${VCPKG_TARGET_TRIPLET}>:-DVCPKG_TARGET_TRIPLET=${VCPKG_TARGET_TRIPLET}>
 | 
			
		||||
        -DCMAKE_DEBUG_POSTFIX=_d
 | 
			
		||||
        $<$<NOT:$<BOOL:${is_multiconfig}>>:-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}>
 | 
			
		||||
        -DgRPC_BUILD_TESTS=OFF
 | 
			
		||||
        -DgRPC_BUILD_CSHARP_EXT=OFF
 | 
			
		||||
        -DgRPC_MSVC_STATIC_RUNTIME=ON
 | 
			
		||||
        -DgRPC_INSTALL=OFF
 | 
			
		||||
        -DgRPC_CARES_PROVIDER=package
 | 
			
		||||
        -Dc-ares_DIR=${cares_binary_dir}/_installed_/lib/cmake/c-ares
 | 
			
		||||
        -DgRPC_SSL_PROVIDER=package
 | 
			
		||||
        -DOPENSSL_ROOT_DIR=${OPENSSL_ROOT_DIR}
 | 
			
		||||
        -DgRPC_PROTOBUF_PROVIDER=package
 | 
			
		||||
        -DProtobuf_USE_STATIC_LIBS=$<IF:$<AND:$<BOOL:${Protobuf_FOUND}>,$<NOT:$<BOOL:${static}>>>,OFF,ON>
 | 
			
		||||
        -DProtobuf_INCLUDE_DIR=$<JOIN:$<TARGET_PROPERTY:protobuf::libprotobuf,INTERFACE_INCLUDE_DIRECTORIES>,:_:>
 | 
			
		||||
        -DProtobuf_LIBRARY=$<IF:$<CONFIG:Debug>,$<TARGET_PROPERTY:protobuf::libprotobuf,IMPORTED_LOCATION_DEBUG>,$<TARGET_PROPERTY:protobuf::libprotobuf,IMPORTED_LOCATION_RELEASE>>
 | 
			
		||||
        -DProtobuf_PROTOC_LIBRARY=$<IF:$<CONFIG:Debug>,$<TARGET_PROPERTY:protobuf::libprotoc,IMPORTED_LOCATION_DEBUG>,$<TARGET_PROPERTY:protobuf::libprotoc,IMPORTED_LOCATION_RELEASE>>
 | 
			
		||||
        -DProtobuf_PROTOC_EXECUTABLE=$<TARGET_PROPERTY:protobuf::protoc,IMPORTED_LOCATION>
 | 
			
		||||
        -DgRPC_ZLIB_PROVIDER=package
 | 
			
		||||
        $<$<NOT:$<BOOL:${has_zlib}>>:-DZLIB_ROOT=${zlib_binary_dir}/_installed_>
 | 
			
		||||
        $<$<BOOL:${MSVC}>:
 | 
			
		||||
          "-DCMAKE_CXX_FLAGS=-GR -Gd -fp:precise -FS -EHa -MP"
 | 
			
		||||
          "-DCMAKE_C_FLAGS=-GR -Gd -fp:precise -FS -MP"
 | 
			
		||||
        >
 | 
			
		||||
    LIST_SEPARATOR :_:
 | 
			
		||||
    TEST_COMMAND ""
 | 
			
		||||
    INSTALL_COMMAND ""
 | 
			
		||||
    DEPENDS c-ares_src
 | 
			
		||||
    BUILD_BYPRODUCTS
 | 
			
		||||
      <BINARY_DIR>/${ep_lib_prefix}grpc${grpc_suffix}${ep_lib_suffix}
 | 
			
		||||
      <BINARY_DIR>/${ep_lib_prefix}grpc${grpc_suffix}_d${ep_lib_suffix}
 | 
			
		||||
      <BINARY_DIR>/${ep_lib_prefix}grpc++${grpc_suffix}${ep_lib_suffix}
 | 
			
		||||
      <BINARY_DIR>/${ep_lib_prefix}grpc++${grpc_suffix}_d${ep_lib_suffix}
 | 
			
		||||
      <BINARY_DIR>/${ep_lib_prefix}address_sorting${ep_lib_suffix}
 | 
			
		||||
      <BINARY_DIR>/${ep_lib_prefix}address_sorting_d${ep_lib_suffix}
 | 
			
		||||
      <BINARY_DIR>/${ep_lib_prefix}gpr${ep_lib_suffix}
 | 
			
		||||
      <BINARY_DIR>/${ep_lib_prefix}gpr_d${ep_lib_suffix}
 | 
			
		||||
      <BINARY_DIR>/grpc_cpp_plugin${CMAKE_EXECUTABLE_SUFFIX}
 | 
			
		||||
  )
 | 
			
		||||
  if (TARGET protobuf_src)
 | 
			
		||||
    ExternalProject_Add_StepDependencies(grpc_src build protobuf_src)
 | 
			
		||||
  endif ()
 | 
			
		||||
  exclude_if_included (grpc_src)
 | 
			
		||||
  ExternalProject_Get_Property (grpc_src BINARY_DIR)
 | 
			
		||||
  ExternalProject_Get_Property (grpc_src SOURCE_DIR)
 | 
			
		||||
  set (grpc_binary_dir "${BINARY_DIR}")
 | 
			
		||||
  set (grpc_source_dir "${SOURCE_DIR}")
 | 
			
		||||
  if (CMAKE_VERBOSE_MAKEFILE)
 | 
			
		||||
    print_ep_logs (grpc_src)
 | 
			
		||||
  endif ()
 | 
			
		||||
  file (MAKE_DIRECTORY ${SOURCE_DIR}/include)
 | 
			
		||||
      LOG_BUILD ON
 | 
			
		||||
      LOG_CONFIGURE ON
 | 
			
		||||
      BUILD_COMMAND
 | 
			
		||||
        ${CMAKE_COMMAND}
 | 
			
		||||
        --build .
 | 
			
		||||
        --config $<CONFIG>
 | 
			
		||||
        $<$<VERSION_GREATER_EQUAL:${CMAKE_VERSION},3.12>:--parallel ${ep_procs}>
 | 
			
		||||
        $<$<BOOL:${is_multiconfig}>:
 | 
			
		||||
          COMMAND
 | 
			
		||||
            ${CMAKE_COMMAND} -E copy
 | 
			
		||||
            <BINARY_DIR>/$<CONFIG>/${ep_lib_prefix}grpc${grpc_suffix}$<$<CONFIG:Debug>:_d>${ep_lib_suffix}
 | 
			
		||||
            <BINARY_DIR>/$<CONFIG>/${ep_lib_prefix}grpc++${grpc_suffix}$<$<CONFIG:Debug>:_d>${ep_lib_suffix}
 | 
			
		||||
            <BINARY_DIR>/$<CONFIG>/${ep_lib_prefix}address_sorting$<$<CONFIG:Debug>:_d>${ep_lib_suffix}
 | 
			
		||||
            <BINARY_DIR>/$<CONFIG>/${ep_lib_prefix}gpr$<$<CONFIG:Debug>:_d>${ep_lib_suffix}
 | 
			
		||||
            <BINARY_DIR>/$<CONFIG>/grpc_cpp_plugin${CMAKE_EXECUTABLE_SUFFIX}
 | 
			
		||||
            <BINARY_DIR>
 | 
			
		||||
          >
 | 
			
		||||
      LIST_SEPARATOR :_:
 | 
			
		||||
      TEST_COMMAND ""
 | 
			
		||||
      INSTALL_COMMAND ""
 | 
			
		||||
      DEPENDS c-ares_src
 | 
			
		||||
      BUILD_BYPRODUCTS
 | 
			
		||||
        <BINARY_DIR>/${ep_lib_prefix}grpc${grpc_suffix}${ep_lib_suffix}
 | 
			
		||||
        <BINARY_DIR>/${ep_lib_prefix}grpc${grpc_suffix}_d${ep_lib_suffix}
 | 
			
		||||
        <BINARY_DIR>/${ep_lib_prefix}grpc++${grpc_suffix}${ep_lib_suffix}
 | 
			
		||||
        <BINARY_DIR>/${ep_lib_prefix}grpc++${grpc_suffix}_d${ep_lib_suffix}
 | 
			
		||||
        <BINARY_DIR>/${ep_lib_prefix}address_sorting${ep_lib_suffix}
 | 
			
		||||
        <BINARY_DIR>/${ep_lib_prefix}address_sorting_d${ep_lib_suffix}
 | 
			
		||||
        <BINARY_DIR>/${ep_lib_prefix}gpr${ep_lib_suffix}
 | 
			
		||||
        <BINARY_DIR>/${ep_lib_prefix}gpr_d${ep_lib_suffix}
 | 
			
		||||
        <BINARY_DIR>/grpc_cpp_plugin${CMAKE_EXECUTABLE_SUFFIX}
 | 
			
		||||
    )
 | 
			
		||||
    if (TARGET protobuf_src)
 | 
			
		||||
      ExternalProject_Add_StepDependencies(grpc_src build protobuf_src)
 | 
			
		||||
    endif ()
 | 
			
		||||
    exclude_if_included (grpc_src)
 | 
			
		||||
    ExternalProject_Get_Property (grpc_src BINARY_DIR)
 | 
			
		||||
    ExternalProject_Get_Property (grpc_src SOURCE_DIR)
 | 
			
		||||
    set (grpc_binary_dir "${BINARY_DIR}")
 | 
			
		||||
    set (grpc_source_dir "${SOURCE_DIR}")
 | 
			
		||||
    if (CMAKE_VERBOSE_MAKEFILE)
 | 
			
		||||
      print_ep_logs (grpc_src)
 | 
			
		||||
    endif ()
 | 
			
		||||
    file (MAKE_DIRECTORY ${SOURCE_DIR}/include)
 | 
			
		||||
 | 
			
		||||
  macro (add_imported_grpc libname_)
 | 
			
		||||
    add_library ("gRPC::${libname_}" STATIC IMPORTED GLOBAL)
 | 
			
		||||
    set_target_properties ("gRPC::${libname_}" PROPERTIES
 | 
			
		||||
      IMPORTED_LOCATION_DEBUG
 | 
			
		||||
        ${grpc_binary_dir}/${ep_lib_prefix}${libname_}_d${ep_lib_suffix}
 | 
			
		||||
      IMPORTED_LOCATION_RELEASE
 | 
			
		||||
        ${grpc_binary_dir}/${ep_lib_prefix}${libname_}${ep_lib_suffix}
 | 
			
		||||
      INTERFACE_INCLUDE_DIRECTORIES
 | 
			
		||||
        ${grpc_source_dir}/include)
 | 
			
		||||
    add_dependencies ("gRPC::${libname_}" grpc_src)
 | 
			
		||||
    target_link_libraries (ripple_libs INTERFACE "gRPC::${libname_}")
 | 
			
		||||
    exclude_if_included ("gRPC::${libname_}")
 | 
			
		||||
  endmacro ()
 | 
			
		||||
    macro (add_imported_grpc libname_)
 | 
			
		||||
      add_library ("gRPC::${libname_}" STATIC IMPORTED GLOBAL)
 | 
			
		||||
      set_target_properties ("gRPC::${libname_}" PROPERTIES
 | 
			
		||||
        IMPORTED_LOCATION_DEBUG
 | 
			
		||||
          ${grpc_binary_dir}/${ep_lib_prefix}${libname_}_d${ep_lib_suffix}
 | 
			
		||||
        IMPORTED_LOCATION_RELEASE
 | 
			
		||||
          ${grpc_binary_dir}/${ep_lib_prefix}${libname_}${ep_lib_suffix}
 | 
			
		||||
        INTERFACE_INCLUDE_DIRECTORIES
 | 
			
		||||
          ${grpc_source_dir}/include)
 | 
			
		||||
      add_dependencies ("gRPC::${libname_}" grpc_src)
 | 
			
		||||
      target_link_libraries (ripple_libs INTERFACE "gRPC::${libname_}")
 | 
			
		||||
      exclude_if_included ("gRPC::${libname_}")
 | 
			
		||||
    endmacro ()
 | 
			
		||||
 | 
			
		||||
  set_target_properties (gRPC::grpc_cpp_plugin PROPERTIES
 | 
			
		||||
      IMPORTED_LOCATION "${grpc_binary_dir}/grpc_cpp_plugin${CMAKE_EXECUTABLE_SUFFIX}")
 | 
			
		||||
  add_dependencies (gRPC::grpc_cpp_plugin grpc_src)
 | 
			
		||||
    set_target_properties (gRPC::grpc_cpp_plugin PROPERTIES
 | 
			
		||||
        IMPORTED_LOCATION "${grpc_binary_dir}/grpc_cpp_plugin${CMAKE_EXECUTABLE_SUFFIX}")
 | 
			
		||||
    add_dependencies (gRPC::grpc_cpp_plugin grpc_src)
 | 
			
		||||
  endif ()
 | 
			
		||||
 | 
			
		||||
  add_imported_grpc (gpr)
 | 
			
		||||
  add_imported_grpc ("grpc${grpc_suffix}")
 | 
			
		||||
  add_imported_grpc ("grpc++${grpc_suffix}")
 | 
			
		||||
  add_imported_grpc (address_sorting)
 | 
			
		||||
 | 
			
		||||
  target_link_libraries ("gRPC::grpc${grpc_suffix}" INTERFACE c-ares::cares gRPC::gpr gRPC::address_sorting ZLIB::ZLIB)
 | 
			
		||||
  target_link_libraries ("gRPC::grpc++${grpc_suffix}" INTERFACE "gRPC::grpc${grpc_suffix}" gRPC::gpr)
 | 
			
		||||
endif ()
 | 
			
		||||
 | 
			
		||||
add_imported_grpc (gpr)
 | 
			
		||||
add_imported_grpc ("grpc${grpc_suffix}")
 | 
			
		||||
add_imported_grpc ("grpc++${grpc_suffix}")
 | 
			
		||||
add_imported_grpc (address_sorting)
 | 
			
		||||
 | 
			
		||||
target_link_libraries ("gRPC::grpc${grpc_suffix}" INTERFACE c-ares::cares gRPC::gpr gRPC::address_sorting ZLIB::ZLIB)
 | 
			
		||||
target_link_libraries ("gRPC::grpc++${grpc_suffix}" INTERFACE "gRPC::grpc${grpc_suffix}" gRPC::gpr)
 | 
			
		||||
 | 
			
		||||
#[=================================[
 | 
			
		||||
   generate protobuf sources for
 | 
			
		||||
   grpc defs and bundle into a
 | 
			
		||||
@@ -333,6 +345,8 @@ add_library (grpc_pbufs STATIC ${GRPC_PROTO_SRCS} ${GRPC_PROTO_HDRS})
 | 
			
		||||
target_include_directories (grpc_pbufs SYSTEM PUBLIC ${GRPC_GEN_DIR})
 | 
			
		||||
target_link_libraries (grpc_pbufs protobuf::libprotobuf "gRPC::grpc++${grpc_suffix}")
 | 
			
		||||
target_compile_options (grpc_pbufs
 | 
			
		||||
  PRIVATE
 | 
			
		||||
    $<$<BOOL:${MSVC}>:-wd4065>
 | 
			
		||||
  PUBLIC
 | 
			
		||||
    $<$<BOOL:${is_xcode}>:
 | 
			
		||||
      --system-header-prefix="google/protobuf"
 | 
			
		||||
 
 | 
			
		||||
@@ -16,8 +16,8 @@ RUN chmod +x /tmp/centos_setup.sh && \
 | 
			
		||||
    chmod +x /tmp/extras.sh
 | 
			
		||||
RUN /tmp/centos_setup.sh
 | 
			
		||||
 | 
			
		||||
RUN /tmp/install_cmake.sh 3.15.2 /opt/local/cmake-3.15
 | 
			
		||||
RUN ln -s /opt/local/cmake-3.15 /opt/local/cmake
 | 
			
		||||
RUN /tmp/install_cmake.sh 3.16.1 /opt/local/cmake-3.16
 | 
			
		||||
RUN ln -s /opt/local/cmake-3.16 /opt/local/cmake
 | 
			
		||||
ENV PATH="/opt/local/cmake/bin:$PATH"
 | 
			
		||||
# also install min supported cmake for testing
 | 
			
		||||
RUN if [ "${CI_USE}" = true ] ; then /tmp/install_cmake.sh 3.9.0 /opt/local/cmake-3.9; fi
 | 
			
		||||
 
 | 
			
		||||
@@ -7,7 +7,7 @@ yum -y upgrade
 | 
			
		||||
yum -y update
 | 
			
		||||
yum -y install epel-release centos-release-scl
 | 
			
		||||
yum -y install \
 | 
			
		||||
    wget curl time gcc-c++ time yum-utils autoconf pkgconfig \
 | 
			
		||||
    wget curl time gcc-c++ time yum-utils autoconf automake pkgconfig libtool \
 | 
			
		||||
    libstdc++-static rpm-build gnupg which make cmake \
 | 
			
		||||
    devtoolset-7 devtoolset-7-gdb devtoolset-7-libasan-devel devtoolset-7-libtsan-devel devtoolset-7-libubsan-devel \
 | 
			
		||||
    devtoolset-8 devtoolset-8-gdb devtoolset-8-binutils devtoolset-8-libstdc++-devel \
 | 
			
		||||
 
 | 
			
		||||
@@ -3,50 +3,31 @@ set -ex
 | 
			
		||||
 | 
			
		||||
if [ "${CI_USE}" = true ] ; then
 | 
			
		||||
    cd /tmp
 | 
			
		||||
    wget https://ftp.gnu.org/gnu/gdb/gdb-8.2.tar.xz
 | 
			
		||||
    tar xf gdb-8.2.tar.xz
 | 
			
		||||
    cd gdb-8.2
 | 
			
		||||
    ./configure CFLAGS="-w -O2" CXXFLAGS="-std=gnu++11 -g -O2 -w" --prefix=/opt/local/gdb-8.2
 | 
			
		||||
    wget https://ftp.gnu.org/gnu/gdb/gdb-8.3.1.tar.xz
 | 
			
		||||
    tar xf gdb-8.3.1.tar.xz
 | 
			
		||||
    cd gdb-8.3
 | 
			
		||||
    ./configure CFLAGS="-w -O2" CXXFLAGS="-std=gnu++11 -g -O2 -w" --prefix=/opt/local/gdb-8.3
 | 
			
		||||
    make -j$(nproc)
 | 
			
		||||
    make install
 | 
			
		||||
    ln -s /opt/local/gdb-8.2 /opt/local/gdb
 | 
			
		||||
    ln -s /opt/local/gdb-8.3 /opt/local/gdb
 | 
			
		||||
    cd ..
 | 
			
		||||
    rm -f gdb-8.2.tar.xz
 | 
			
		||||
    rm -rf gdb-8.2
 | 
			
		||||
    rm -f gdb-8.3.tar.xz
 | 
			
		||||
    rm -rf gdb-8.3
 | 
			
		||||
 | 
			
		||||
    # clang from source
 | 
			
		||||
    RELEASE=tags/RELEASE_701/final
 | 
			
		||||
    INSTALL=/opt/llvm-7.0.1/
 | 
			
		||||
    mkdir -p /tmp/clang-src
 | 
			
		||||
    cd /tmp/clang-src
 | 
			
		||||
    TOPDIR=`pwd`
 | 
			
		||||
    svn co -q http://llvm.org/svn/llvm-project/llvm/${RELEASE} llvm
 | 
			
		||||
    cd ${TOPDIR}/llvm/tools
 | 
			
		||||
    svn co -q http://llvm.org/svn/llvm-project/cfe/${RELEASE} clang
 | 
			
		||||
    cd ${TOPDIR}/llvm/tools/clang/tools
 | 
			
		||||
    svn co -q http://llvm.org/svn/llvm-project/clang-tools-extra/${RELEASE} extra
 | 
			
		||||
    cd ${TOPDIR}/llvm/tools
 | 
			
		||||
    svn co -q http://llvm.org/svn/llvm-project/lld/${RELEASE} lld
 | 
			
		||||
    cd ${TOPDIR}/llvm/tools
 | 
			
		||||
    svn co -q http://llvm.org/svn/llvm-project/polly/${RELEASE} polly
 | 
			
		||||
    cd ${TOPDIR}/llvm/projects
 | 
			
		||||
    svn co -q http://llvm.org/svn/llvm-project/compiler-rt/${RELEASE} compiler-rt
 | 
			
		||||
    cd ${TOPDIR}/llvm/projects
 | 
			
		||||
    svn co -q http://llvm.org/svn/llvm-project/openmp/${RELEASE} openmp
 | 
			
		||||
    cd ${TOPDIR}/llvm/projects
 | 
			
		||||
    svn co -q http://llvm.org/svn/llvm-project/libcxx/${RELEASE} libcxx
 | 
			
		||||
    svn co -q http://llvm.org/svn/llvm-project/libcxxabi/${RELEASE} libcxxabi
 | 
			
		||||
    cd ${TOPDIR}/llvm/projects
 | 
			
		||||
    ## config/build
 | 
			
		||||
    cd ${TOPDIR}
 | 
			
		||||
    cd /tmp
 | 
			
		||||
    git clone https://github.com/llvm/llvm-project.git
 | 
			
		||||
    cd llvm-project
 | 
			
		||||
    git checkout llvmorg-9.0.0
 | 
			
		||||
    INSTALL=/opt/llvm-9/
 | 
			
		||||
    mkdir mybuilddir && cd mybuilddir
 | 
			
		||||
    # TODO figure out necessary options
 | 
			
		||||
    cmake ../llvm -G Ninja \
 | 
			
		||||
      -DCMAKE_BUILD_TYPE=Release \
 | 
			
		||||
      -DLLVM_ENABLE_PROJECTS='clang;clang-tools-extra;libcxx;libcxxabi;lldb;compiler-rt;lld;polly' \
 | 
			
		||||
      -DCMAKE_INSTALL_PREFIX=${INSTALL} \
 | 
			
		||||
      -DLLVM_LIBDIR_SUFFIX=64 \
 | 
			
		||||
      -DLLVM_ENABLE_EH=ON \
 | 
			
		||||
      -DLLVM_ENABLE_RTTI=ON
 | 
			
		||||
      -DLLVM_LIBDIR_SUFFIX=64
 | 
			
		||||
    cmake --build . --parallel --target install
 | 
			
		||||
    cd /tmp
 | 
			
		||||
    rm -rf clang-src
 | 
			
		||||
    rm -rf llvm-project
 | 
			
		||||
fi
 | 
			
		||||
 
 | 
			
		||||
@@ -9,24 +9,15 @@ else
 | 
			
		||||
    echo "invalid package type"
 | 
			
		||||
    exit 1
 | 
			
		||||
fi
 | 
			
		||||
if docker pull "${ARTIFACTORY_HUB}/${container_name}:${CI_COMMIT_SHA}"; then
 | 
			
		||||
    echo "${pkgtype} container for ${CI_COMMIT_SHA} already exists" \
 | 
			
		||||
        "- skipping container build!"
 | 
			
		||||
    exit 0
 | 
			
		||||
else
 | 
			
		||||
    echo "no existing ${pkgtype} container for this branch - searching history."
 | 
			
		||||
    for CID_PREV in $(git log --pretty=%H -n30) ; do
 | 
			
		||||
        if docker pull "${ARTIFACTORY_HUB}/${container_name}:${CID_PREV}"; then
 | 
			
		||||
            echo "found container for previous commit ${CID_PREV}" \
 | 
			
		||||
                "- using as cache."
 | 
			
		||||
            docker tag \
 | 
			
		||||
               "${ARTIFACTORY_HUB}/${container_name}:${CID_PREV}" \
 | 
			
		||||
               "${container_name}:${CID_PREV}"
 | 
			
		||||
            CMAKE_EXTRA="-D${pkgtype}_cache_from=${container_name}:${CID_PREV}"
 | 
			
		||||
            break
 | 
			
		||||
        fi
 | 
			
		||||
    done
 | 
			
		||||
 | 
			
		||||
if docker pull "${ARTIFACTORY_HUB}/${container_name}:latest_${CI_COMMIT_REF_SLUG}"; then
 | 
			
		||||
    echo "found container for latest - using as cache."
 | 
			
		||||
    docker tag \
 | 
			
		||||
       "${ARTIFACTORY_HUB}/${container_name}:latest_${CI_COMMIT_REF_SLUG}" \
 | 
			
		||||
       "${container_name}:latest_${CI_COMMIT_REF_SLUG}"
 | 
			
		||||
    CMAKE_EXTRA="-D${pkgtype}_cache_from=${container_name}:latest_${CI_COMMIT_REF_SLUG}"
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
cmake --version
 | 
			
		||||
test -d build && rm -rf build
 | 
			
		||||
mkdir -p build/container && cd build/container
 | 
			
		||||
@@ -34,8 +25,4 @@ eval time \
 | 
			
		||||
    cmake -Dpackages_only=ON -DCMAKE_VERBOSE_MAKEFILE=ON ${CMAKE_EXTRA} \
 | 
			
		||||
    -G Ninja ../..
 | 
			
		||||
time cmake --build . --target "${pkgtype}_container" -- -v
 | 
			
		||||
docker tag \
 | 
			
		||||
    "${container_name}:${CI_COMMIT_SHA}" \
 | 
			
		||||
    "${ARTIFACTORY_HUB}/${container_name}:${CI_COMMIT_SHA}"
 | 
			
		||||
time docker push "${ARTIFACTORY_HUB}/${container_name}:${CI_COMMIT_SHA}"
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -2,22 +2,27 @@
 | 
			
		||||
set -ex
 | 
			
		||||
pkgtype=$1
 | 
			
		||||
if [ "${pkgtype}" = "rpm" ] ; then
 | 
			
		||||
    container_name="${RPM_CONTAINER_NAME}"
 | 
			
		||||
    container_name="${RPM_CONTAINER_FULLNAME}"
 | 
			
		||||
    container_tag="${RPM_CONTAINER_TAG}"
 | 
			
		||||
elif [ "${pkgtype}" = "dpkg" ] ; then
 | 
			
		||||
    container_name="${DPKG_CONTAINER_NAME}"
 | 
			
		||||
    container_name="${DPKG_CONTAINER_FULLNAME}"
 | 
			
		||||
    container_tag="${DPKG_CONTAINER_TAG}"
 | 
			
		||||
else
 | 
			
		||||
    echo "invalid package type"
 | 
			
		||||
    exit 1
 | 
			
		||||
fi
 | 
			
		||||
time docker pull "${ARTIFACTORY_HUB}/${container_name}:${CI_COMMIT_SHA}"
 | 
			
		||||
time docker pull "${ARTIFACTORY_HUB}/${container_name}"
 | 
			
		||||
docker tag \
 | 
			
		||||
  "${ARTIFACTORY_HUB}/${container_name}:${CI_COMMIT_SHA}" \
 | 
			
		||||
  "${container_name}:${CI_COMMIT_SHA}"
 | 
			
		||||
  "${ARTIFACTORY_HUB}/${container_name}" \
 | 
			
		||||
  "${container_name}"
 | 
			
		||||
docker images
 | 
			
		||||
test -d build && rm -rf build
 | 
			
		||||
mkdir -p build/${pkgtype} && cd build/${pkgtype}
 | 
			
		||||
time cmake \
 | 
			
		||||
  -Dpackages_only=ON -Dhave_package_container=ON -DCMAKE_VERBOSE_MAKEFILE=ON \
 | 
			
		||||
  -Dpackages_only=ON \
 | 
			
		||||
  -Dcontainer_label="${container_tag}" \
 | 
			
		||||
  -Dhave_package_container=ON \
 | 
			
		||||
  -DCMAKE_VERBOSE_MAKEFILE=ON \
 | 
			
		||||
  -G Ninja ../..
 | 
			
		||||
time cmake --build . --target ${pkgtype} -- -v
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -8,8 +8,15 @@
 | 
			
		||||
# NOTE: these are sensible defaults for Ripple pipelines. These
 | 
			
		||||
# can be overridden by project or group variables as needed.
 | 
			
		||||
variables:
 | 
			
		||||
  # these containers are built manually using the rippled
 | 
			
		||||
  # cmake build (container targets) and tagged/pushed so they 
 | 
			
		||||
  # can be used here
 | 
			
		||||
  RPM_CONTAINER_TAG: "2020-01-08"
 | 
			
		||||
  RPM_CONTAINER_NAME: "rippled-rpm-builder"
 | 
			
		||||
  RPM_CONTAINER_FULLNAME: "${RPM_CONTAINER_NAME}:${RPM_CONTAINER_TAG}"
 | 
			
		||||
  DPKG_CONTAINER_TAG: "2020-01-08"
 | 
			
		||||
  DPKG_CONTAINER_NAME: "rippled-dpkg-builder"
 | 
			
		||||
  DPKG_CONTAINER_FULLNAME: "${DPKG_CONTAINER_NAME}:${DPKG_CONTAINER_TAG}"
 | 
			
		||||
  ARTIFACTORY_HOST: "artifactory.ops.ripple.com"
 | 
			
		||||
  ARTIFACTORY_HUB: "${ARTIFACTORY_HOST}:6555"
 | 
			
		||||
  GIT_SIGN_PUBKEYS_URL: "https://gitlab.ops.ripple.com/snippets/11/raw"
 | 
			
		||||
@@ -19,7 +26,6 @@ variables:
 | 
			
		||||
  #   IS_PRIMARY_REPO = "true"
 | 
			
		||||
 | 
			
		||||
stages:
 | 
			
		||||
  - build_containers
 | 
			
		||||
  - build_packages
 | 
			
		||||
  - sign_packages
 | 
			
		||||
  - smoketest
 | 
			
		||||
@@ -31,6 +37,7 @@ stages:
 | 
			
		||||
  - push_to_prod
 | 
			
		||||
  - verify_from_prod
 | 
			
		||||
  - get_final_hashes
 | 
			
		||||
  - build_containers
 | 
			
		||||
 | 
			
		||||
.dind_template: &dind_param
 | 
			
		||||
  before_script:
 | 
			
		||||
@@ -65,35 +72,6 @@ stages:
 | 
			
		||||
  script:
 | 
			
		||||
    - . ./Builds/containers/gitlab-ci/smoketest.sh repo
 | 
			
		||||
 | 
			
		||||
#########################################################################
 | 
			
		||||
##                                                                     ##
 | 
			
		||||
##  stage: build_containers                                            ##
 | 
			
		||||
##                                                                     ##
 | 
			
		||||
##  build containers from docker definitions. These containers are     ##
 | 
			
		||||
##  subsequently used to build the rpm and deb packages.               ##
 | 
			
		||||
##                                                                     ##
 | 
			
		||||
#########################################################################
 | 
			
		||||
 | 
			
		||||
build_centos_container:
 | 
			
		||||
  stage: build_containers
 | 
			
		||||
  <<: *dind_param
 | 
			
		||||
  cache:
 | 
			
		||||
    key: containers
 | 
			
		||||
    paths:
 | 
			
		||||
      - .nih_c
 | 
			
		||||
  script:
 | 
			
		||||
    - . ./Builds/containers/gitlab-ci/build_container.sh rpm
 | 
			
		||||
 | 
			
		||||
build_ubuntu_container:
 | 
			
		||||
  stage: build_containers
 | 
			
		||||
  <<: *dind_param
 | 
			
		||||
  cache:
 | 
			
		||||
    key: containers
 | 
			
		||||
    paths:
 | 
			
		||||
      - .nih_c
 | 
			
		||||
  script:
 | 
			
		||||
    - . ./Builds/containers/gitlab-ci/build_container.sh dpkg
 | 
			
		||||
 | 
			
		||||
#########################################################################
 | 
			
		||||
##                                                                     ##
 | 
			
		||||
##  stage: build_packages                                              ##
 | 
			
		||||
@@ -104,31 +82,19 @@ build_ubuntu_container:
 | 
			
		||||
 | 
			
		||||
rpm_build:
 | 
			
		||||
  stage: build_packages
 | 
			
		||||
  dependencies:
 | 
			
		||||
    - build_centos_container
 | 
			
		||||
  <<: *dind_param
 | 
			
		||||
  artifacts:
 | 
			
		||||
    paths:
 | 
			
		||||
      - build/rpm/packages/
 | 
			
		||||
  cache:
 | 
			
		||||
    key: rpm
 | 
			
		||||
    paths:
 | 
			
		||||
      - .nih_c/pkgbuild
 | 
			
		||||
  script:
 | 
			
		||||
    - . ./Builds/containers/gitlab-ci/build_package.sh rpm
 | 
			
		||||
 | 
			
		||||
dpkg_build:
 | 
			
		||||
  stage: build_packages
 | 
			
		||||
  dependencies:
 | 
			
		||||
    - build_ubuntu_container
 | 
			
		||||
  <<: *dind_param
 | 
			
		||||
  artifacts:
 | 
			
		||||
    paths:
 | 
			
		||||
      - build/dpkg/packages/
 | 
			
		||||
  cache:
 | 
			
		||||
    key: dpkg
 | 
			
		||||
    paths:
 | 
			
		||||
      - .nih_c/pkgbuild
 | 
			
		||||
  script:
 | 
			
		||||
    - . ./Builds/containers/gitlab-ci/build_package.sh dpkg
 | 
			
		||||
 | 
			
		||||
@@ -146,7 +112,7 @@ rpm_sign:
 | 
			
		||||
    - rpm_build
 | 
			
		||||
  image:
 | 
			
		||||
    name: centos:7
 | 
			
		||||
    # <<: *dind_param
 | 
			
		||||
  <<: *only_primary
 | 
			
		||||
  before_script:
 | 
			
		||||
  - |
 | 
			
		||||
    # Make sure GnuPG is installed
 | 
			
		||||
@@ -175,7 +141,7 @@ dpkg_sign:
 | 
			
		||||
    - dpkg_build
 | 
			
		||||
  image:
 | 
			
		||||
    name: ubuntu:18.04
 | 
			
		||||
    # <<: *dind_param
 | 
			
		||||
  <<: *only_primary
 | 
			
		||||
  before_script:
 | 
			
		||||
  - |
 | 
			
		||||
    # make sure we have GnuPG
 | 
			
		||||
@@ -210,6 +176,7 @@ dpkg_sign:
 | 
			
		||||
centos_7_smoketest:
 | 
			
		||||
  stage: smoketest
 | 
			
		||||
  dependencies:
 | 
			
		||||
    - rpm_build
 | 
			
		||||
    - rpm_sign
 | 
			
		||||
  image:
 | 
			
		||||
    name: centos:7
 | 
			
		||||
@@ -218,6 +185,7 @@ centos_7_smoketest:
 | 
			
		||||
fedora_29_smoketest:
 | 
			
		||||
  stage: smoketest
 | 
			
		||||
  dependencies:
 | 
			
		||||
    - rpm_build
 | 
			
		||||
    - rpm_sign
 | 
			
		||||
  image:
 | 
			
		||||
    name: fedora:29
 | 
			
		||||
@@ -226,6 +194,7 @@ fedora_29_smoketest:
 | 
			
		||||
fedora_28_smoketest:
 | 
			
		||||
  stage: smoketest
 | 
			
		||||
  dependencies:
 | 
			
		||||
    - rpm_build
 | 
			
		||||
    - rpm_sign
 | 
			
		||||
  image:
 | 
			
		||||
    name: fedora:28
 | 
			
		||||
@@ -234,6 +203,7 @@ fedora_28_smoketest:
 | 
			
		||||
fedora_27_smoketest:
 | 
			
		||||
  stage: smoketest
 | 
			
		||||
  dependencies:
 | 
			
		||||
    - rpm_build
 | 
			
		||||
    - rpm_sign
 | 
			
		||||
  image:
 | 
			
		||||
    name: fedora:27
 | 
			
		||||
@@ -245,6 +215,7 @@ fedora_27_smoketest:
 | 
			
		||||
ubuntu_19_smoketest:
 | 
			
		||||
  stage: smoketest
 | 
			
		||||
  dependencies:
 | 
			
		||||
    - dpkg_build
 | 
			
		||||
    - dpkg_sign
 | 
			
		||||
  image:
 | 
			
		||||
    name: ubuntu:19.04
 | 
			
		||||
@@ -253,6 +224,7 @@ ubuntu_19_smoketest:
 | 
			
		||||
ubuntu_18_smoketest:
 | 
			
		||||
  stage: smoketest
 | 
			
		||||
  dependencies:
 | 
			
		||||
    - dpkg_build
 | 
			
		||||
    - dpkg_sign
 | 
			
		||||
  image:
 | 
			
		||||
    name: ubuntu:18.04
 | 
			
		||||
@@ -261,6 +233,7 @@ ubuntu_18_smoketest:
 | 
			
		||||
ubuntu_16_smoketest:
 | 
			
		||||
  stage: smoketest
 | 
			
		||||
  dependencies:
 | 
			
		||||
    - dpkg_build
 | 
			
		||||
    - dpkg_sign
 | 
			
		||||
  image:
 | 
			
		||||
    name: ubuntu:16.04
 | 
			
		||||
@@ -269,6 +242,7 @@ ubuntu_16_smoketest:
 | 
			
		||||
debian_9_smoketest:
 | 
			
		||||
  stage: smoketest
 | 
			
		||||
  dependencies:
 | 
			
		||||
    - dpkg_build
 | 
			
		||||
    - dpkg_sign
 | 
			
		||||
  image:
 | 
			
		||||
    name: debian:9
 | 
			
		||||
@@ -621,3 +595,28 @@ get_prod_hashes:
 | 
			
		||||
  script:
 | 
			
		||||
    - . ./Builds/containers/gitlab-ci/push_to_artifactory.sh "GET" ".checksums"
 | 
			
		||||
 | 
			
		||||
#########################################################################
 | 
			
		||||
##                                                                     ##
 | 
			
		||||
##  stage: build_containers                                            ##
 | 
			
		||||
##                                                                     ##
 | 
			
		||||
##  build containers from docker definitions. These containers are NOT ##
 | 
			
		||||
##  used for the package build. This step is only used to ensure that  ##
 | 
			
		||||
##  the package build targets and files are still working properly.    ##
 | 
			
		||||
##                                                                     ##
 | 
			
		||||
#########################################################################
 | 
			
		||||
 | 
			
		||||
build_centos_container:
 | 
			
		||||
  stage: build_containers
 | 
			
		||||
  <<: *dind_param
 | 
			
		||||
  script:
 | 
			
		||||
    - . ./Builds/containers/gitlab-ci/build_container.sh rpm
 | 
			
		||||
  allow_failure: true
 | 
			
		||||
 | 
			
		||||
build_ubuntu_container:
 | 
			
		||||
  stage: build_containers
 | 
			
		||||
  <<: *dind_param
 | 
			
		||||
  script:
 | 
			
		||||
    - . ./Builds/containers/gitlab-ci/build_container.sh dpkg
 | 
			
		||||
  allow_failure: true
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -4,17 +4,17 @@ docker login -u rippled \
 | 
			
		||||
    -p ${ARTIFACTORY_DEPLOY_KEY_RIPPLED} "${ARTIFACTORY_HUB}"
 | 
			
		||||
# this gives us rippled_version :
 | 
			
		||||
source build/rpm/packages/build_vars
 | 
			
		||||
docker pull "${ARTIFACTORY_HUB}/${RPM_CONTAINER_NAME}:${CI_COMMIT_SHA}"
 | 
			
		||||
docker pull "${ARTIFACTORY_HUB}/${DPKG_CONTAINER_NAME}:${CI_COMMIT_SHA}"
 | 
			
		||||
docker pull "${ARTIFACTORY_HUB}/${RPM_CONTAINER_FULLNAME}"
 | 
			
		||||
docker pull "${ARTIFACTORY_HUB}/${DPKG_CONTAINER_FULLNAME}"
 | 
			
		||||
# tag/push two labels...one using the current rippled version and one just using "latest"
 | 
			
		||||
for label in ${rippled_version} latest ; do
 | 
			
		||||
    docker tag \
 | 
			
		||||
        "${ARTIFACTORY_HUB}/${RPM_CONTAINER_NAME}:${CI_COMMIT_SHA}" \
 | 
			
		||||
        "${ARTIFACTORY_HUB}/${RPM_CONTAINER_FULLNAME}" \
 | 
			
		||||
        "${ARTIFACTORY_HUB}/${RPM_CONTAINER_NAME}:${label}_${CI_COMMIT_REF_SLUG}"
 | 
			
		||||
    docker tag \
 | 
			
		||||
        "${ARTIFACTORY_HUB}/${DPKG_CONTAINER_NAME}:${CI_COMMIT_SHA}" \
 | 
			
		||||
        "${ARTIFACTORY_HUB}/${DPKG_CONTAINER_FULLNAME}" \
 | 
			
		||||
        "${ARTIFACTORY_HUB}/${DPKG_CONTAINER_NAME}:${label}_${CI_COMMIT_REF_SLUG}"
 | 
			
		||||
    docker push "${ARTIFACTORY_HUB}/${RPM_CONTAINER_NAME}"
 | 
			
		||||
    docker push "${ARTIFACTORY_HUB}/${DPKG_CONTAINER_NAME}"
 | 
			
		||||
    docker push "${ARTIFACTORY_HUB}/${RPM_CONTAINER_FULLNAME}"
 | 
			
		||||
    docker push "${ARTIFACTORY_HUB}/${DPKG_CONTAINER_FULLNAME}"
 | 
			
		||||
done
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -19,7 +19,7 @@ override_dh_auto_configure:
 | 
			
		||||
	cmake .. -G Ninja \
 | 
			
		||||
		-DCMAKE_INSTALL_PREFIX=/opt/ripple \
 | 
			
		||||
		-DCMAKE_BUILD_TYPE=Release \
 | 
			
		||||
		-Dstatic=true \
 | 
			
		||||
		-Dstatic=ON \
 | 
			
		||||
		-Dvalidator_keys=ON \
 | 
			
		||||
		-DCMAKE_VERBOSE_MAKEFILE=ON
 | 
			
		||||
 | 
			
		||||
@@ -33,5 +33,8 @@ override_dh_auto_install:
 | 
			
		||||
	install -D Builds/containers/shared/update-rippled.sh debian/tmp/opt/ripple/bin/update-rippled.sh
 | 
			
		||||
	install -D Builds/containers/shared/update-rippled-cron debian/tmp/opt/ripple/etc/update-rippled-cron
 | 
			
		||||
	install -D Builds/containers/shared/rippled-logrotate debian/tmp/etc/logrotate.d/rippled
 | 
			
		||||
	rm -rf debian/tmp/opt/ripple/lib64/cmake/date
 | 
			
		||||
	rm -rf bld
 | 
			
		||||
	rm -rf bld_vl
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -41,6 +41,7 @@ test -e /etc/pki/tls || { mkdir -p /etc/pki; ln -s /usr/lib/ssl /etc/pki/tls; }
 | 
			
		||||
%install
 | 
			
		||||
rm -rf $RPM_BUILD_ROOT
 | 
			
		||||
DESTDIR=$RPM_BUILD_ROOT cmake --build rippled/bld.release --target install -- -v
 | 
			
		||||
rm -rf ${RPM_BUILD_ROOT}/%{_prefix}/lib64/cmake/date
 | 
			
		||||
install -d ${RPM_BUILD_ROOT}/etc/opt/ripple
 | 
			
		||||
install -d ${RPM_BUILD_ROOT}/usr/local/bin
 | 
			
		||||
ln -s %{_prefix}/etc/rippled.cfg ${RPM_BUILD_ROOT}/etc/opt/ripple/rippled.cfg
 | 
			
		||||
 
 | 
			
		||||
@@ -22,7 +22,7 @@ build_boost "1.70.0" true
 | 
			
		||||
# installed in opt, so won't be used
 | 
			
		||||
# unless specified by OPENSSL_ROOT_DIR
 | 
			
		||||
cd /tmp
 | 
			
		||||
OPENSSL_VER=1.1.1
 | 
			
		||||
OPENSSL_VER=1.1.1d
 | 
			
		||||
wget https://www.openssl.org/source/openssl-${OPENSSL_VER}.tar.gz
 | 
			
		||||
tar xf openssl-${OPENSSL_VER}.tar.gz
 | 
			
		||||
cd openssl-${OPENSSL_VER}
 | 
			
		||||
@@ -36,6 +36,18 @@ rm -f openssl-${OPENSSL_VER}.tar.gz
 | 
			
		||||
rm -rf openssl-${OPENSSL_VER}
 | 
			
		||||
LD_LIBRARY_PATH=${LD_LIBRARY_PATH:-}:/opt/local/openssl/lib /opt/local/openssl/bin/openssl version -a
 | 
			
		||||
 | 
			
		||||
cd /tmp
 | 
			
		||||
wget https://libarchive.org/downloads/libarchive-3.4.1.tar.gz
 | 
			
		||||
tar xzf libarchive-3.4.1.tar.gz
 | 
			
		||||
cd libarchive-3.4.1
 | 
			
		||||
mkdir _bld && cd _bld
 | 
			
		||||
cmake -DCMAKE_BUILD_TYPE=Release ..
 | 
			
		||||
make -j$(nproc)
 | 
			
		||||
make install
 | 
			
		||||
cd ../..
 | 
			
		||||
rm -f libarchive-3.4.1.tar.gz
 | 
			
		||||
rm -rf libarchive-3.4.1
 | 
			
		||||
 | 
			
		||||
cd /tmp
 | 
			
		||||
wget https://github.com/protocolbuffers/protobuf/releases/download/v3.10.1/protobuf-all-3.10.1.tar.gz
 | 
			
		||||
tar xf protobuf-all-3.10.1.tar.gz
 | 
			
		||||
@@ -50,13 +62,24 @@ rm -f protobuf-all-3.10.1.tar.gz
 | 
			
		||||
rm -rf protobuf-3.10.1
 | 
			
		||||
 | 
			
		||||
cd /tmp
 | 
			
		||||
wget https://github.com/c-ares/c-ares/releases/download/cares-1_15_0/c-ares-1.15.0.tar.gz
 | 
			
		||||
wget https://c-ares.haxx.se/download/c-ares-1.15.0.tar.gz
 | 
			
		||||
tar xf c-ares-1.15.0.tar.gz
 | 
			
		||||
cd c-ares-1.15.0
 | 
			
		||||
./configure
 | 
			
		||||
mkdir _bld && cd _bld
 | 
			
		||||
cmake \
 | 
			
		||||
  -DHAVE_LIBNSL=OFF \
 | 
			
		||||
  -DCMAKE_BUILD_TYPE=Release \
 | 
			
		||||
  -DCARES_STATIC=ON \
 | 
			
		||||
  -DCARES_SHARED=OFF \
 | 
			
		||||
  -DCARES_INSTALL=ON \
 | 
			
		||||
  -DCARES_STATIC_PIC=ON \
 | 
			
		||||
  -DCARES_BUILD_TOOLS=OFF \
 | 
			
		||||
  -DCARES_BUILD_TESTS=OFF \
 | 
			
		||||
  -DCARES_BUILD_CONTAINER_TESTS=OFF \
 | 
			
		||||
  ..
 | 
			
		||||
make -j$(nproc)
 | 
			
		||||
make install
 | 
			
		||||
cd ..
 | 
			
		||||
cd ../..
 | 
			
		||||
rm -f c-ares-1.15.0.tar.gz
 | 
			
		||||
rm -rf c-ares-1.15.0
 | 
			
		||||
 | 
			
		||||
@@ -64,13 +87,26 @@ cd /tmp
 | 
			
		||||
wget https://github.com/grpc/grpc/archive/v1.25.0.tar.gz
 | 
			
		||||
tar xf v1.25.0.tar.gz
 | 
			
		||||
cd grpc-1.25.0
 | 
			
		||||
mkdir _bld && cd _bld
 | 
			
		||||
cmake \
 | 
			
		||||
  -DCMAKE_BUILD_TYPE=Release \
 | 
			
		||||
  -DBUILD_SHARED_LIBS=OFF \
 | 
			
		||||
  -DgRPC_ZLIB_PROVIDER=package \
 | 
			
		||||
  -DgRPC_CARES_PROVIDER=package \
 | 
			
		||||
  -DgRPC_SSL_PROVIDER=package \
 | 
			
		||||
  -DgRPC_PROTOBUF_PROVIDER=package \
 | 
			
		||||
  -DProtobuf_USE_STATIC_LIBS=ON \
 | 
			
		||||
  ..
 | 
			
		||||
make -j$(nproc)
 | 
			
		||||
make install
 | 
			
		||||
cd ..
 | 
			
		||||
cd ../..
 | 
			
		||||
rm -f xf v1.25.0.tar.gz
 | 
			
		||||
rm -rf grpc-1.25.0
 | 
			
		||||
 | 
			
		||||
if [ "${CI_USE}" = true ] ; then
 | 
			
		||||
 | 
			
		||||
    build_boost "1.71.0" false
 | 
			
		||||
 | 
			
		||||
    cd /tmp
 | 
			
		||||
    wget https://github.com/doxygen/doxygen/archive/Release_1_8_16.tar.gz
 | 
			
		||||
    tar xf Release_1_8_16.tar.gz
 | 
			
		||||
@@ -96,15 +132,15 @@ if [ "${CI_USE}" = true ] ; then
 | 
			
		||||
    rm -r lcov-1.14 lcov-1.14.tar.gz
 | 
			
		||||
 | 
			
		||||
    cd /tmp
 | 
			
		||||
    wget https://github.com/ccache/ccache/releases/download/v3.7.3/ccache-3.7.3.tar.gz
 | 
			
		||||
    tar xf ccache-3.7.3.tar.gz
 | 
			
		||||
    cd ccache-3.7.3
 | 
			
		||||
    wget https://github.com/ccache/ccache/releases/download/v3.7.6/ccache-3.7.6.tar.gz
 | 
			
		||||
    tar xf ccache-3.7.6.tar.gz
 | 
			
		||||
    cd ccache-3.7.6
 | 
			
		||||
    ./configure --prefix=/usr/local
 | 
			
		||||
    make
 | 
			
		||||
    make install
 | 
			
		||||
    cd ..
 | 
			
		||||
    rm -f ccache-3.7.3.tar.gz
 | 
			
		||||
    rm -rf ccache-3.7.3
 | 
			
		||||
    rm -f ccache-3.7.6.tar.gz
 | 
			
		||||
    rm -rf ccache-3.7.6
 | 
			
		||||
 | 
			
		||||
    pip install requests
 | 
			
		||||
    pip install https://github.com/codecov/codecov-python/archive/master.zip
 | 
			
		||||
 
 | 
			
		||||
@@ -9,6 +9,7 @@
 | 
			
		||||
set -exu
 | 
			
		||||
 | 
			
		||||
odir=$(pwd)
 | 
			
		||||
: ${BOOST_TOOLSET:=msvc-14.1}
 | 
			
		||||
 | 
			
		||||
if [[ -d "$BOOST_ROOT/lib" || -d "${BOOST_ROOT}/stage/lib" ]] ; then
 | 
			
		||||
    echo "Using cached boost at $BOOST_ROOT"
 | 
			
		||||
@@ -21,7 +22,8 @@ ext="${fn##*.}"
 | 
			
		||||
wget --quiet $BOOST_URL -O /tmp/boost.tar.${ext}
 | 
			
		||||
cd $(dirname $BOOST_ROOT)
 | 
			
		||||
rm -fr ${BOOST_ROOT}
 | 
			
		||||
tar xf /tmp/boost.tar.${ext}
 | 
			
		||||
mkdir ${BOOST_ROOT}
 | 
			
		||||
tar xf /tmp/boost.tar.${ext} -C ${BOOST_ROOT} --strip-components 1
 | 
			
		||||
cd $BOOST_ROOT
 | 
			
		||||
 | 
			
		||||
BLDARGS=()
 | 
			
		||||
@@ -60,7 +62,7 @@ if [[ -z ${COMSPEC:-} ]]; then
 | 
			
		||||
else
 | 
			
		||||
    BLDARGS+=(runtime-link="static,shared")
 | 
			
		||||
    BLDARGS+=(--layout=versioned)
 | 
			
		||||
    BLDARGS+=(--toolset="msvc-14.1")
 | 
			
		||||
    BLDARGS+=(--toolset="${BOOST_TOOLSET}")
 | 
			
		||||
    BLDARGS+=(address-model=64)
 | 
			
		||||
    BLDARGS+=(architecture=x86)
 | 
			
		||||
    BLDARGS+=(link=static)
 | 
			
		||||
 
 | 
			
		||||
@@ -15,8 +15,8 @@ RUN chmod +x /tmp/ubuntu_setup.sh && \
 | 
			
		||||
    chmod +x /tmp/install_cmake.sh
 | 
			
		||||
RUN /tmp/ubuntu_setup.sh
 | 
			
		||||
 | 
			
		||||
RUN /tmp/install_cmake.sh 3.15.2 /opt/local/cmake-3.15
 | 
			
		||||
RUN ln -s /opt/local/cmake-3.15 /opt/local/cmake
 | 
			
		||||
RUN /tmp/install_cmake.sh 3.16.1 /opt/local/cmake-3.16
 | 
			
		||||
RUN ln -s /opt/local/cmake-3.16 /opt/local/cmake
 | 
			
		||||
ENV PATH="/opt/local/cmake/bin:$PATH"
 | 
			
		||||
# also install min supported cmake for testing
 | 
			
		||||
RUN if [ "${CI_USE}" = true ] ; then /tmp/install_cmake.sh 3.9.0 /opt/local/cmake-3.9; fi
 | 
			
		||||
 
 | 
			
		||||
@@ -30,7 +30,7 @@ apt-get -y clean
 | 
			
		||||
apt-get -y update
 | 
			
		||||
 | 
			
		||||
apt-get -y --fix-missing install \
 | 
			
		||||
    make cmake ninja-build autoconf libtool pkg-config \
 | 
			
		||||
    make cmake ninja-build autoconf automake libtool pkg-config libtool \
 | 
			
		||||
    openssl libssl-dev \
 | 
			
		||||
    liblzma-dev libbz2-dev zlib1g-dev \
 | 
			
		||||
    libjemalloc-dev \
 | 
			
		||||
@@ -158,36 +158,6 @@ update-alternatives --install \
 | 
			
		||||
update-alternatives --auto clang
 | 
			
		||||
 | 
			
		||||
if [ "${CI_USE}" = true ] ; then
 | 
			
		||||
    apt-get -y install \
 | 
			
		||||
        clang-5.0 libclang-common-5.0-dev libclang-5.0-dev libllvm5.0 llvm-5.0 \
 | 
			
		||||
        llvm-5.0-dev llvm-5.0-runtime clang-format-5.0 python-clang-5.0 \
 | 
			
		||||
        lld-5.0 libfuzzer-5.0-dev
 | 
			
		||||
    update-alternatives --install \
 | 
			
		||||
        /usr/bin/clang clang /usr/bin/clang-5.0 10 \
 | 
			
		||||
        --slave /usr/bin/clang++ clang++ /usr/bin/clang++-5.0 \
 | 
			
		||||
        --slave /usr/bin/llvm-profdata llvm-profdata /usr/bin/llvm-profdata-5.0 \
 | 
			
		||||
        --slave /usr/bin/asan-symbolize asan-symbolize /usr/bin/asan_symbolize-5.0 \
 | 
			
		||||
        --slave /usr/bin/llvm-symbolizer llvm-symbolizer /usr/bin/llvm-symbolizer-5.0 \
 | 
			
		||||
        --slave /usr/bin/clang-format clang-format /usr/bin/clang-format-5.0 \
 | 
			
		||||
        --slave /usr/bin/llvm-ar llvm-ar /usr/bin/llvm-ar-5.0 \
 | 
			
		||||
        --slave /usr/bin/llvm-cov llvm-cov /usr/bin/llvm-cov-5.0 \
 | 
			
		||||
        --slave /usr/bin/llvm-nm llvm-nm /usr/bin/llvm-nm-5.0
 | 
			
		||||
 | 
			
		||||
    apt-get -y install \
 | 
			
		||||
        clang-6.0 libclang-common-6.0-dev libclang-6.0-dev libllvm6.0 llvm-6.0 \
 | 
			
		||||
        llvm-6.0-dev llvm-6.0-runtime clang-format-6.0 python-clang-6.0 \
 | 
			
		||||
        lld-6.0 libfuzzer-6.0-dev
 | 
			
		||||
    update-alternatives --install \
 | 
			
		||||
        /usr/bin/clang clang /usr/bin/clang-6.0 12 \
 | 
			
		||||
        --slave /usr/bin/clang++ clang++ /usr/bin/clang++-6.0 \
 | 
			
		||||
        --slave /usr/bin/llvm-profdata llvm-profdata /usr/bin/llvm-profdata-6.0 \
 | 
			
		||||
        --slave /usr/bin/asan-symbolize asan-symbolize /usr/bin/asan_symbolize-6.0 \
 | 
			
		||||
        --slave /usr/bin/llvm-symbolizer llvm-symbolizer /usr/bin/llvm-symbolizer-6.0 \
 | 
			
		||||
        --slave /usr/bin/clang-format clang-format /usr/bin/clang-format-6.0 \
 | 
			
		||||
        --slave /usr/bin/llvm-ar llvm-ar /usr/bin/llvm-ar-6.0 \
 | 
			
		||||
        --slave /usr/bin/llvm-cov llvm-cov /usr/bin/llvm-cov-6.0 \
 | 
			
		||||
        --slave /usr/bin/llvm-nm llvm-nm /usr/bin/llvm-nm-6.0
 | 
			
		||||
 | 
			
		||||
    apt-get -y install \
 | 
			
		||||
        clang-9 libclang-common-9-dev libclang-9-dev libllvm9 llvm-9 \
 | 
			
		||||
        llvm-9-dev llvm-9-runtime clang-format-9 python-clang-9 \
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,9 @@
 | 
			
		||||
cmake_minimum_required (VERSION 3.9.0)
 | 
			
		||||
 | 
			
		||||
if (POLICY CMP0074)
 | 
			
		||||
  cmake_policy(SET CMP0074 NEW)
 | 
			
		||||
endif ()
 | 
			
		||||
 | 
			
		||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/Builds/CMake")
 | 
			
		||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/Builds/CMake/deps")
 | 
			
		||||
 | 
			
		||||
@@ -19,10 +24,6 @@ if (target)
 | 
			
		||||
endif ()
 | 
			
		||||
project (rippled)
 | 
			
		||||
 | 
			
		||||
if (POLICY CMP0074)
 | 
			
		||||
  cmake_policy(SET CMP0074 NEW)
 | 
			
		||||
endif ()
 | 
			
		||||
 | 
			
		||||
include(RippledSanity)
 | 
			
		||||
include(RippledVersion)
 | 
			
		||||
include(RippledSettings)
 | 
			
		||||
 
 | 
			
		||||
@@ -1,33 +1,51 @@
 | 
			
		||||
#!/usr/bin/env bash
 | 
			
		||||
set -exu
 | 
			
		||||
 | 
			
		||||
: ${TRAVIS_BUILD_DIR:=""}
 | 
			
		||||
: ${VCPKG_DIR:=".vcpkg"}
 | 
			
		||||
export VCPKG_ROOT=${VCPKG_DIR}
 | 
			
		||||
: ${VCPKG_DEFAULT_TRIPLET:="x64-windows-static"}
 | 
			
		||||
 | 
			
		||||
export VCPKG_DEFAULT_TRIPLET
 | 
			
		||||
 | 
			
		||||
EXE="vcpkg"
 | 
			
		||||
if [[ -z ${COMSPEC:-} ]]; then
 | 
			
		||||
    EXE="vcpkg"
 | 
			
		||||
else
 | 
			
		||||
    EXE="vcpkg.exe"
 | 
			
		||||
    EXE="${EXE}.exe"
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
if [[ -d "${VCPKG_DIR}" && -x "${VCPKG_DIR}/${EXE}" ]] ; then
 | 
			
		||||
if [[ -d "${VCPKG_DIR}" && -x "${VCPKG_DIR}/${EXE}" && -d "${VCPKG_DIR}/installed" ]] ; then
 | 
			
		||||
    echo "Using cached vcpkg at ${VCPKG_DIR}"
 | 
			
		||||
    ${VCPKG_DIR}/${EXE} list
 | 
			
		||||
    exit
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
if [[ -d "${VCPKG_DIR}" ]] ; then
 | 
			
		||||
    rm -rf "${VCPKG_DIR}"
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
git clone --branch 2019.10 https://github.com/Microsoft/vcpkg.git ${VCPKG_DIR}
 | 
			
		||||
pushd ${VCPKG_DIR}
 | 
			
		||||
if [[ -z ${COMSPEC:-} ]]; then
 | 
			
		||||
    chmod +x ./bootstrap-vcpkg.sh
 | 
			
		||||
    ./bootstrap-vcpkg.sh
 | 
			
		||||
else
 | 
			
		||||
    ./bootstrap-vcpkg.bat
 | 
			
		||||
    if [[ -d "${VCPKG_DIR}" ]] ; then
 | 
			
		||||
        rm -rf "${VCPKG_DIR}"
 | 
			
		||||
    fi
 | 
			
		||||
    git clone --branch 2019.11 https://github.com/Microsoft/vcpkg.git ${VCPKG_DIR}
 | 
			
		||||
    pushd ${VCPKG_DIR}
 | 
			
		||||
    BSARGS=()
 | 
			
		||||
    if [[ "$(uname)" == "Darwin" ]] ; then
 | 
			
		||||
        BSARGS+=(--allowAppleClang)
 | 
			
		||||
    fi
 | 
			
		||||
    if [[ -z ${COMSPEC:-} ]]; then
 | 
			
		||||
        chmod +x ./bootstrap-vcpkg.sh
 | 
			
		||||
        time ./bootstrap-vcpkg.sh "${BSARGS[@]}"
 | 
			
		||||
    else
 | 
			
		||||
        time ./bootstrap-vcpkg.bat
 | 
			
		||||
    fi
 | 
			
		||||
    popd
 | 
			
		||||
fi
 | 
			
		||||
popd
 | 
			
		||||
# TODO  -- can pin specific ports to a commit/version like this:
 | 
			
		||||
#git checkout <SOME COMMIT HASH> ports/boost
 | 
			
		||||
 | 
			
		||||
${VCPKG_DIR}/${EXE} install openssl
 | 
			
		||||
# TODO: bring boost in this way as well ?
 | 
			
		||||
# NOTE: can pin specific ports to a commit/version like this:
 | 
			
		||||
#    git checkout <SOME COMMIT HASH> ports/boost
 | 
			
		||||
if [ $# -eq 0 ]; then
 | 
			
		||||
    echo "No extra packages specified..."
 | 
			
		||||
    PKGS=()
 | 
			
		||||
else
 | 
			
		||||
    PKGS=( "$@" )
 | 
			
		||||
fi
 | 
			
		||||
for LIB in "${PKGS[@]}"; do
 | 
			
		||||
    time ${VCPKG_DIR}/${EXE} --clean-after-build install ${LIB}
 | 
			
		||||
done
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -22,6 +22,8 @@ while read line ; do
 | 
			
		||||
    fi
 | 
			
		||||
  fi
 | 
			
		||||
done <<EOL
 | 
			
		||||
"C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Auxiliary/Build/vcvarsall.bat" x86_amd64
 | 
			
		||||
"C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Auxiliary/Build/vcvarsall.bat" x86_amd64
 | 
			
		||||
"C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Auxiliary/Build/vcvarsall.bat" x86_amd64
 | 
			
		||||
"C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build/vcvarsall.bat" x86_amd64
 | 
			
		||||
"C:/Program Files (x86)/Microsoft Visual Studio 15.0/VC/vcvarsall.bat" amd64
 | 
			
		||||
 
 | 
			
		||||
@@ -27,7 +27,12 @@ namespace ripple {
 | 
			
		||||
Message::Message (::google::protobuf::Message const& message, int type)
 | 
			
		||||
    : mCategory(TrafficCount::categorize(message, type, false))
 | 
			
		||||
{
 | 
			
		||||
    auto const messageBytes = message.ByteSizeLong();
 | 
			
		||||
 | 
			
		||||
#if defined(GOOGLE_PROTOBUF_VERSION) && (GOOGLE_PROTOBUF_VERSION >= 3011000)
 | 
			
		||||
    auto const messageBytes = message.ByteSizeLong ();
 | 
			
		||||
#else
 | 
			
		||||
    unsigned const messageBytes = message.ByteSize ();
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    assert (messageBytes != 0);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,42 +0,0 @@
 | 
			
		||||
// Unity build file for libprotobuf by Vinnie Falco <vinnie.falco@gmail.com>
 | 
			
		||||
//
 | 
			
		||||
 | 
			
		||||
#include "google/protobuf/descriptor.cc"
 | 
			
		||||
#include "google/protobuf/descriptor.pb.cc"
 | 
			
		||||
#include "google/protobuf/descriptor_database.cc"
 | 
			
		||||
#include "google/protobuf/dynamic_message.cc"
 | 
			
		||||
#include "google/protobuf/extension_set.cc"
 | 
			
		||||
#include "google/protobuf/extension_set_heavy.cc"
 | 
			
		||||
#include "google/protobuf/generated_message_reflection.cc"
 | 
			
		||||
#include "google/protobuf/generated_message_util.cc"
 | 
			
		||||
#include "google/protobuf/message.cc"
 | 
			
		||||
#include "google/protobuf/message_lite.cc"
 | 
			
		||||
#include "google/protobuf/reflection_ops.cc"
 | 
			
		||||
#include "google/protobuf/repeated_field.cc"
 | 
			
		||||
#include "google/protobuf/service.cc"
 | 
			
		||||
#include "google/protobuf/text_format.cc"
 | 
			
		||||
#include "google/protobuf/unknown_field_set.cc"
 | 
			
		||||
#include "google/protobuf/wire_format.cc"
 | 
			
		||||
#include "google/protobuf/wire_format_lite.cc"
 | 
			
		||||
 | 
			
		||||
#include "google/protobuf/compiler/importer.cc"
 | 
			
		||||
#include "google/protobuf/compiler/parser.cc"
 | 
			
		||||
 | 
			
		||||
#include "google/protobuf/io/coded_stream.cc"
 | 
			
		||||
#include "google/protobuf/io/gzip_stream.cc"
 | 
			
		||||
#include "google/protobuf/io/tokenizer.cc"
 | 
			
		||||
#include "google/protobuf/io/zero_copy_stream.cc"
 | 
			
		||||
#include "google/protobuf/io/zero_copy_stream_impl.cc"
 | 
			
		||||
#include "google/protobuf/io/zero_copy_stream_impl_lite.cc"
 | 
			
		||||
 | 
			
		||||
#include "google/protobuf/stubs/common.cc"
 | 
			
		||||
#include "google/protobuf/stubs/once.cc"
 | 
			
		||||
#include "google/protobuf/stubs/stringprintf.cc"
 | 
			
		||||
#include "google/protobuf/stubs/structurally_valid.cc"
 | 
			
		||||
#include "google/protobuf/stubs/strutil.cc"
 | 
			
		||||
#include "google/protobuf/stubs/substitute.cc"
 | 
			
		||||
 | 
			
		||||
#ifdef _MSC_VER // MSVC
 | 
			
		||||
#include "google/protobuf/stubs/atomicops_internals_x86_msvc.cc"
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user