build google on windows

This commit is contained in:
Bassem Girgis
2019-08-13 22:24:00 -05:00
parent cd9426335c
commit f44a68dae8
3 changed files with 132 additions and 12 deletions

View File

@@ -1,5 +1,15 @@
#!/bin/bash
unameOut="$(uname -s)"
case "${unameOut}" in
Linux*) machineArch=Linux;;
Darwin*) machineArch=MacOS;;
CYGWIN*) machineArch=Windows;;
MINGW*) machineArch=Windows;;
*) machineArch="UNKNOWN:${unameOut}"
esac
echo ${machineArch}
libVer=1.8.1
echo libVer=$libVer
@@ -29,4 +39,36 @@ mkdir -p $libSrcPath
tar zxvpf $libFilePath -C $buildPath
( cd $libBuildPath && cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS:BOOL=TRUE -DCMAKE_INSTALL_PREFIX:PATH=$libInstallPath $libSrcPath && make install -j)
if [ "${machineArch}" = "Linux" ]; then
( cd $libBuildPath && \
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS:BOOL=TRUE \
-DCMAKE_INSTALL_PREFIX:PATH=$libInstallPath \
$libSrcPath && \
make install -j)
elif [ "${machineArch}" = "MacOS" ]; then
( cd $libBuildPath && \
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS:BOOL=TRUE \
-DCMAKE_INSTALL_PREFIX:PATH=$libInstallPath \
$libSrcPath && \
make install -j)
elif [ "${machineArch}" = "Windows" ]; then
( cd $libBuildPath && \
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS:BOOL=TRUE \
-DCMAKE_INSTALL_PREFIX:PATH=$libInstallPath \
-G "Visual Studio 16 2019" \
-A x64 \
$libSrcPath && \
cmake \
--build . \
--config Release \
--target INSTALL)
else
echo "unknown architecture"
exit 1
fi