diff options
author | Alexey Edelev <alexey.edelev@qt.io> | 2022-05-25 15:52:23 +0200 |
---|---|---|
committer | Mårten Nordheim <marten.nordheim@qt.io> | 2022-09-08 10:27:54 +0200 |
commit | ad84c5cb8a02acc8ee98871b06e1207418dd0afd (patch) | |
tree | fdac3f2b2e1c0d57bd038e78bbb29da607c2a806 /coin/provisioning/common/unix/install_protobuff.sh | |
parent | b09cac44488986dbf3e1b3fb7eafaee71117099a (diff) |
Update protobuf provisioning scripts
Enable protobuf provisioning for all linux platforms, since it's
required to build qtbase with protobuf support.
Delete install_protobuff for macos 10.14 since it's not used and
wouldn't build without special casing.
Change-Id: I9c7dea876c45dbcbfc3110b106ae683bbe9179ec
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'coin/provisioning/common/unix/install_protobuff.sh')
-rwxr-xr-x | coin/provisioning/common/unix/install_protobuff.sh | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/coin/provisioning/common/unix/install_protobuff.sh b/coin/provisioning/common/unix/install_protobuff.sh index fb5ae853..eb5dea24 100755 --- a/coin/provisioning/common/unix/install_protobuff.sh +++ b/coin/provisioning/common/unix/install_protobuff.sh @@ -44,7 +44,14 @@ source "${BASH_SOURCE%/*}/DownloadURL.sh" # shellcheck source=./SetEnvVar.sh source "${BASH_SOURCE%/*}/SetEnvVar.sh" -# This script will install Google's Protocal Buffers which is needed by Automotive Suite +# Extract cmake path from the environment +if uname -a |grep -q "Ubuntu"; then + source ~/.profile +else + source ~/.bashrc +fi + +# This script will install Google's Protocal Buffers version="3.6.1" sha1="44b8ba225f3b4dc45fb56d5881ec6a91329802b6" @@ -63,15 +70,19 @@ if uname -a |grep -qv "Darwin"; then fi echo "Configuring and building protobuf" -cd "$targetDir" + +installPrefix="/usr/local" if uname -a |grep -q Darwin; then - ./configure --prefix "$(xcrun --sdk macosx --show-sdk-path)/usr/local" - SetEnvVar PATH "\$PATH:$(xcrun --sdk macosx --show-sdk-path)/usr/local/bin" -else - ./configure + extraCMakeArgs=-DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" + SetEnvVar PATH "\$PATH:$installPrefix/bin" fi -make -j5 -sudo make install + +buildDir="$HOME/build-protobuf-$version" +mkdir "$buildDir" +cd "$buildDir" +cmake $targetDir/cmake -G"Ninja Multi-Config" -DCMAKE_INSTALL_PREFIX=$installPrefix $extraCMakeArgs -Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_BUILD_EXAMPLES=OFF -Dprotobuf_BUILD_PROTOC_BINARIES=ON -DBUILD_SHARED_LIBS=OFF -Dprotobuf_WITH_ZLIB=OFF -DCMAKE_CONFIGURATION_TYPES="Release;Debug;RelWithDebugInfo" -DCMAKE_CROSS_CONFIGS=all -DCMAKE_DEFAULT_CONFIGS=all +ninja all:all +sudo env "PATH=$PATH" ninja install:all # Refresh shared library cache if OS isn't macOS if uname -a |grep -qv "Darwin"; then @@ -79,3 +90,4 @@ if uname -a |grep -qv "Darwin"; then fi sudo rm -r "$targetDir" +sudo rm -r "$buildDir" |