diff --git a/recipe/bld.bat b/recipe/bld.bat index 31508c4..9c40600 100644 --- a/recipe/bld.bat +++ b/recipe/bld.bat @@ -10,12 +10,13 @@ cmake -G "Ninja" ^ -S . -B build ^ -DGOOGLE_CLOUD_CPP_ENABLE=__ga_libraries__ ^ -DBUILD_TESTING=OFF ^ - -DBUILD_SHARED_LIBS=OFF ^ + -DBUILD_SHARED_LIBS=ON ^ -DCMAKE_BUILD_TYPE=Release ^ -DCMAKE_CXX_STANDARD=17 ^ -DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%" ^ -DCMAKE_MODULE_PATH="%LIBRARY_PREFIX%/lib/cmake" ^ -DCMAKE_INSTALL_LIBDIR=lib ^ + -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON ^ -DGOOGLE_CLOUD_CPP_ENABLE_EXAMPLES=OFF ^ -DGOOGLE_CLOUD_CPP_ENABLE_WERROR=OFF if %ERRORLEVEL% neq 0 exit 1 diff --git a/recipe/build-libgoogle-cloud.bat b/recipe/build-libgoogle-cloud.bat index 6eceaf4..fe1d1f6 100644 --- a/recipe/build-libgoogle-cloud.bat +++ b/recipe/build-libgoogle-cloud.bat @@ -7,10 +7,9 @@ set BUILD_PREFIX="%BUILD_PREFIX:\=/%" set SRC_DIR="%SRC_DIR:\=/%" if [%PKG_NAME%] == [libgoogle-cloud] ( - @rem cmake --install build_cmake --component google_cloud_cpp_runtime + cmake --install build --component google_cloud_cpp_runtime if %ERRORLEVEL% neq 0 exit 1 ) else ( - @rem cmake --install build_cmake --component google_cloud_cpp_development - cmake --install build + cmake --install build --component google_cloud_cpp_development if %ERRORLEVEL% neq 0 exit 1 ) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 2c2e5d6..5b0c560 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -18,9 +18,14 @@ source: - patches/0001-disable-libraries.patch # [libprotobuf == "3.21"] # backport https://github.com/googleapis/google-cloud-cpp/pull/11782 - patches/0002-fix-better-support-for-cross-compilation-11782.patch + # don't try to build the protobuf-heavy googleapis as shared on win + - patches/0003-do-not-try-to-build-external-googleapis-as-shared.patch # [win] build: number: 1 + # debug + skip: true # [not win] + requirements: build: - {{ compiler('c') }} @@ -41,7 +46,7 @@ requirements: outputs: - name: libgoogle-cloud - script: build-libgoogle-cloud.sh # [unix] + script: build-libgoogle-cloud.sh # [unix] script: build-libgoogle-cloud.bat # [win] build: run_exports: @@ -66,26 +71,25 @@ outputs: - google-cloud-cpp {{ version }} *_{{ PKG_BUILDNUM }} test: commands: - - test -f $PREFIX/lib/libgoogle_cloud_cpp_storage.{{ version }}.dylib # [osx] - - test -f $PREFIX/lib/libgoogle_cloud_cpp_storage.so.{{ version }} # [linux] - - test ! -f $PREFIX/lib/pkgconfig/google_cloud_cpp_storage.pc # [not win] - - test ! -f $PREFIX/lib/cmake/google_cloud_cpp_storage/google_cloud_cpp_storage-config.cmake # [not win] - - test ! -f $PREFIX/include/google/cloud/storage/version.h # [not win] - - test -f $PREFIX/lib/libgoogle_cloud_cpp_bigtable.{{ version }}.dylib # [osx] - - test -f $PREFIX/lib/libgoogle_cloud_cpp_bigtable.so.{{ version }} # [linux] - - test ! -f $PREFIX/lib/cmake/google_cloud_cpp_bigtable/google_cloud_cpp_bigtable-config.cmake # [not win] - - test ! -f $PREFIX/include/google/cloud/bigtable/version.h # [not win] - # Currently, the windows build is static. - #- if not exist %LIBRARY_PREFIX%\\bin\\libgoogle_cloud_cpp_storage.dll exit 1 # [win] - #- if not exist %LIBRARY_PREFIX%\\lib\\pkgconfig\\google_cloud_cpp_storage.pc exit 1 # [win] - - if exist %LIBRARY_PREFIX%\\lib\\cmake\\google_cloud_cpp_storage\\google_cloud_cpp_storage-config.cmake exit 1 # [win] - - if exist %LIBRARY_PREFIX%\\include\\google\\cloud\\storage\\version.h exit 1 # [win] - #- if not exist %LIBRARY_PREFIX%\\bin\\libgoogle_cloud_cpp_bigtable.dll exit 1 # [win] - - if exist %LIBRARY_PREFIX%\\lib\\cmake\\google_cloud_cpp_bigtable\\google_cloud_cpp_bigtable-config.cmake exit 1 # [win] - - if exist %LIBRARY_PREFIX%\\include\\google\\cloud\\bigtable\\version.h exit 1 # [win] + {% for component in ["bigtable", "storage"] %} + # shared libs + - test -f $PREFIX/lib/libgoogle_cloud_cpp_{{ component }}.so.{{ version }} # [linux] + - test -f $PREFIX/lib/libgoogle_cloud_cpp_{{ component }}.{{ version }}.dylib # [osx] + - if not exist %LIBRARY_BIN%\\libgoogle_cloud_cpp_{{ component }}.dll exit 1 # [win] + - if not exist %LIBRARY_LIB%\\libgoogle_cloud_cpp_{{ component }}.lib exit 1 # [win] + # absence of headers + - test ! -f $PREFIX/include/google/cloud/{{ component }}/version.h # [unix] + - if exist %LIBRARY_INC%\\google\\cloud\\{{ component }}\\version.h exit 1 # [win] + # absence of metadata (pkgconfig) + - test ! -f $PREFIX/lib/pkgconfig/google_cloud_cpp_{{ component }}.pc # [unix] + - if exist %LIBRARY_LIB%\\pkgconfig\\google_cloud_cpp_{{ component }}.pc exit 1 # [win] + # absence of metadata (CMake) + - test ! -f $PREFIX/lib/cmake/google_cloud_cpp_{{ component }}/google_cloud_cpp_{{ component }}-config.cmake # [unix] + - if exist %LIBRARY_LIB%\\cmake\\google_cloud_cpp_{{ component }}\\google_cloud_cpp_{{ component }}-config.cmake exit 1 # [win] + {% endfor %} - name: google-cloud-cpp - script: build-libgoogle-cloud.sh # [unix] + script: build-libgoogle-cloud.sh # [unix] script: build-libgoogle-cloud.bat # [win] build: run_exports: @@ -114,17 +118,6 @@ outputs: # as required; if possible, this should be removed upstream - zlib test: - commands: - - ./run_test_google_cloud_cpp.sh # [unix] - - ./run_test_google_cloud_cpp.bat # [win] - - test -f $PREFIX/lib/cmake/google_cloud_cpp_storage/google_cloud_cpp_storage-config.cmake # [not win] - - test -f $PREFIX/include/google/cloud/storage/version.h # [not win] - - test -f $PREFIX/lib/cmake/google_cloud_cpp_bigtable/google_cloud_cpp_bigtable-config.cmake # [not win] - - test -f $PREFIX/include/google/cloud/bigtable/version.h # [not win] - - if not exist %LIBRARY_PREFIX%\\lib\\cmake\\google_cloud_cpp_storage\\google_cloud_cpp_storage-config.cmake exit 1 # [win] - - if not exist %LIBRARY_PREFIX%\\include\\google\\cloud\\storage\\version.h exit 1 # [win] - - if not exist %LIBRARY_PREFIX%\\lib\\cmake\\google_cloud_cpp_bigtable\\google_cloud_cpp_bigtable-config.cmake exit 1 # [win] - - if not exist %LIBRARY_PREFIX%\\include\\google\\cloud\\bigtable\\version.h exit 1 # [win] requires: - {{ compiler('cxx') }} - cmake @@ -135,6 +128,20 @@ outputs: source_files: - google/cloud/storage/quickstart/*.cc - google/cloud/storage/quickstart/CMakeLists.txt + commands: + - ./run_test_google_cloud_cpp.sh # [unix] + - ./run_test_google_cloud_cpp.bat # [win] + {% for component in ["bigtable", "storage"] %} + # headers + - test -f $PREFIX/include/google/cloud/{{ component }}/version.h # [unix] + - if not exist %LIBRARY_INC%\\google\\cloud\\{{ component }}\\version.h exit 1 # [win] + # pkgconfig + - test -f $PREFIX/lib/pkgconfig/google_cloud_cpp_{{ component }}.pc # [unix] + - if not exist %LIBRARY_LIB%\\pkgconfig\\google_cloud_cpp_{{ component }}.pc exit 1 # [win] + # CMake + - test -f $PREFIX/lib/cmake/google_cloud_cpp_{{ component }}/google_cloud_cpp_{{ component }}-config.cmake # [unix] + - if not exist %LIBRARY_LIB%\\cmake\\google_cloud_cpp_{{ component }}\\google_cloud_cpp_{{ component }}-config.cmake exit 1 # [win] + {% endfor %} about: home: https://github.com/googleapis/google-cloud-cpp diff --git a/recipe/patches/0001-disable-libraries.patch b/recipe/patches/0001-disable-libraries.patch index b524b5b..06a79a3 100644 --- a/recipe/patches/0001-disable-libraries.patch +++ b/recipe/patches/0001-disable-libraries.patch @@ -1,7 +1,7 @@ From f014c88e7ea57ec2907edf26752264566ef7fa0a Mon Sep 17 00:00:00 2001 From: Carlos O'Ryan Date: Tue, 7 Feb 2023 01:35:26 +0000 -Subject: [PATCH 1/2] disable libraries +Subject: [PATCH 1/3] disable libraries --- cmake/GoogleCloudCppFeatures.cmake | 6 +++--- diff --git a/recipe/patches/0002-fix-better-support-for-cross-compilation-11782.patch b/recipe/patches/0002-fix-better-support-for-cross-compilation-11782.patch index e1ec633..398e1f3 100644 --- a/recipe/patches/0002-fix-better-support-for-cross-compilation-11782.patch +++ b/recipe/patches/0002-fix-better-support-for-cross-compilation-11782.patch @@ -1,7 +1,7 @@ From ddfa37bdafcf5ae551157676f5086518f720417d Mon Sep 17 00:00:00 2001 From: Carlos O'Ryan Date: Tue, 6 Jun 2023 11:30:17 -0400 -Subject: [PATCH 2/2] fix: better support for cross-compilation (#11782) +Subject: [PATCH 2/3] fix: better support for cross-compilation (#11782) Allow overrides for the `protobuf::protoc` and `gRPC::grpc_cpp_plugin` targets. On cross-compilation builds the targets point to the binaries diff --git a/recipe/patches/0003-do-not-try-to-build-external-googleapis-as-shared.patch b/recipe/patches/0003-do-not-try-to-build-external-googleapis-as-shared.patch new file mode 100644 index 0000000..072f8c8 --- /dev/null +++ b/recipe/patches/0003-do-not-try-to-build-external-googleapis-as-shared.patch @@ -0,0 +1,24 @@ +From d9f5e22ce65f427a42d5988fa7227d2dc257b7db Mon Sep 17 00:00:00 2001 +From: "H. Vetinari" +Date: Wed, 31 Aug 2022 19:00:34 +0200 +Subject: [PATCH 3/3] do not try to build external/googleapis as shared + +--- + CMakeLists.txt | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 028802691d..59fb481451 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -207,7 +207,10 @@ host environment. + "find_dependency(Protobuf)") + find_package(Protobuf REQUIRED) + endif () ++ # do not try to build googleapis shared on windows ++ set(BUILD_SHARED_LIBS OFF) + add_subdirectory(external/googleapis) ++ set(BUILD_SHARED_LIBS ON) + endif () + + # Enable testing in this directory so we can do a top-level `make test`. This