diff --git a/Libraries/googletest/Include/gtest/internal/custom/README.md b/Libraries/googletest/Include/gtest/internal/custom/README.md deleted file mode 100644 index cb49e2c75..000000000 --- a/Libraries/googletest/Include/gtest/internal/custom/README.md +++ /dev/null @@ -1,44 +0,0 @@ -# Customization Points - -The custom directory is an injection point for custom user configurations. - -## Header `gtest.h` - -### The following macros can be defined: - -* `GTEST_OS_STACK_TRACE_GETTER_` - The name of an implementation of - `OsStackTraceGetterInterface`. -* `GTEST_CUSTOM_TEMPDIR_FUNCTION_` - An override for `testing::TempDir()`. See - `testing::TempDir` for semantics and signature. - -## Header `gtest-port.h` - -The following macros can be defined: - -### Logging: - -* `GTEST_LOG_(severity)` -* `GTEST_CHECK_(condition)` -* Functions `LogToStderr()` and `FlushInfoLog()` have to be provided too. - -### Threading: - -* `GTEST_HAS_NOTIFICATION_` - Enabled if Notification is already provided. -* `GTEST_HAS_MUTEX_AND_THREAD_LOCAL_` - Enabled if `Mutex` and `ThreadLocal` - are already provided. Must also provide `GTEST_DECLARE_STATIC_MUTEX_(mutex)` - and `GTEST_DEFINE_STATIC_MUTEX_(mutex)` -* `GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)` -* `GTEST_LOCK_EXCLUDED_(locks)` - -### Underlying library support features - -* `GTEST_HAS_CXXABI_H_` - -### Exporting API symbols: - -* `GTEST_API_` - Specifier for exported symbols. - -## Header `gtest-printers.h` - -* See documentation at `gtest/gtest-printers.h` for details on how to define a - custom printer. diff --git a/Libraries/googletest/Include/gtest/internal/custom/gtest-port.h b/Libraries/googletest/Include/gtest/internal/custom/gtest-port.h deleted file mode 100644 index db02881c0..000000000 --- a/Libraries/googletest/Include/gtest/internal/custom/gtest-port.h +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2015, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Injection point for custom user configurations. See README for details -// -// ** Custom implementation starts here ** - -#ifndef GOOGLETEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_ -#define GOOGLETEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_ - -#endif // GOOGLETEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_ diff --git a/Libraries/googletest/Include/gtest/internal/custom/gtest-printers.h b/Libraries/googletest/Include/gtest/internal/custom/gtest-printers.h deleted file mode 100644 index b9495d837..000000000 --- a/Libraries/googletest/Include/gtest/internal/custom/gtest-printers.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2015, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// This file provides an injection point for custom printers in a local -// installation of gTest. -// It will be included from gtest-printers.h and the overrides in this file -// will be visible to everyone. -// -// Injection point for custom user configurations. See README for details -// -// ** Custom implementation starts here ** - -#ifndef GOOGLETEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_ -#define GOOGLETEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_ - -#endif // GOOGLETEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_ diff --git a/Libraries/googletest/Include/gtest/internal/custom/gtest.h b/Libraries/googletest/Include/gtest/internal/custom/gtest.h deleted file mode 100644 index afaaf17ba..000000000 --- a/Libraries/googletest/Include/gtest/internal/custom/gtest.h +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2015, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Injection point for custom user configurations. See README for details -// -// ** Custom implementation starts here ** - -#ifndef GOOGLETEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_H_ -#define GOOGLETEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_H_ - -#endif // GOOGLETEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_H_ diff --git a/submodules/update_libs.bat b/submodules/update_libs.bat index b7d2f1ff0..836331798 100644 --- a/submodules/update_libs.bat +++ b/submodules/update_libs.bat @@ -1,127 +1,145 @@ @echo off +setlocal EnableDelayedExpansion set base_path=%~dp0 -echo %base_path% cd %base_path% if not exist "..\Libraries\" (mkdir "..\Libraries") +set update_lib=%~1 REM updating the cpp-base64 library -set lib_name="cpp-base64" -set lib_path_src="%base_path%%lib_name%\" - -cd %lib_name% -set "tag=" -for /f %%i in ('git describe --contains HEAD') do set "tag=%%i" - -cd %base_path% -REM delete the destination library folder when updating -RD /S /Q "..\Libraries\%lib_name%" -set lib_path_dest="..\Libraries\%lib_name%\" -mkdir %lib_path_dest% - -mkdir "%lib_path_dest%Include" -mkdir "%lib_path_dest%Source" -copy %lib_path_src%base*.h "%lib_path_dest%Include" /Y -copy %lib_path_src%base*.cpp "%lib_path_dest%Source" /Y - -echo "%tag%" >"%lib_path_dest%%lib_name%_%tag%.txt" - - -REM updating the fast_float library -set lib_name="fast_float" -set lib_path_src="%base_path%%lib_name%\" - -cd %lib_name% -set "tag=" -for /f %%i in ('git describe --contains HEAD') do set "tag=%%i" - -cd %base_path% -REM delete the destination library folder when updating -RD /S /Q "..\Libraries\%lib_name%" -set lib_path_dest="..\Libraries\%lib_name%\" -mkdir %lib_path_dest% - -mkdir "%lib_path_dest%Include" -copy %lib_path_src%*.h "%lib_path_dest%Include" /Y - -echo "%tag%" >"%lib_path_dest%%lib_name%_%tag%.txt" - - - -REM updating the zlib library -set lib_name="zlib" -set lib_path_src="%base_path%%lib_name%\" - -cd %lib_name% -set "tag=" -for /f %%i in ('git describe --contains HEAD') do set "tag=%%i" - -cd %base_path% -REM delete the destination library folder when updating -RD /S /Q "..\Libraries\%lib_name%" -set lib_path_dest="..\Libraries\%lib_name%\" -mkdir %lib_path_dest% - -mkdir "%lib_path_dest%Include" -mkdir "%lib_path_dest%Source" -copy %lib_path_src%*.h "%lib_path_dest%Include" /Y -copy %lib_path_src%*.c "%lib_path_dest%Source" /Y - -echo "%tag%" >"%lib_path_dest%%lib_name%_%tag%.txt" - - -REM updating the libzip library -set lib_name=libzip -set lib_path_src=%base_path%%lib_name%\ -cd %lib_name% -set "tag=" -for /f %%i in ('git describe --contains HEAD') do set "tag=%%i" - -cd %base_path% -REM delete the destination library folder when updating -RD /S /Q "..\Libraries\%lib_name%" -set lib_path_dest=..\Libraries\%lib_name%\ -mkdir %lib_path_dest% - -mkdir "%lib_path_dest%Include" -mkdir "%lib_path_dest%Source" -REM when copying files for libzip exclude external lib files aes, crypto, xz, zstd, bzip2 -robocopy *.h %lib_path_src%lib\ "%lib_path_dest%Include" /XF *crypto* -robocopy *.c %lib_path_src%lib\ "%lib_path_dest%Source" /XF *crypto* *aes* *bzip2* *xz* *zstd* *win32* *unix* *stdio_named* *uwp* - -REM copy windows specific files to win and unix specific files to unix folders -mkdir "%lib_path_dest%Source\win" -mkdir "%lib_path_dest%Source\unix" -robocopy *win32*.c %lib_path_src%lib\ "%lib_path_dest%Source\win" -robocopy *unix*.c *stdio_named*.c %lib_path_src%lib\ "%lib_path_dest%Source\unix" - -REM generate autogenerated file using cmake script run -cd %lib_path_dest%Source\ -cmake -DPROJECT_SOURCE_DIR=%lib_path_src% -P %lib_path_src%cmake\GenerateZipErrorStrings.cmake -cd %base_path% -echo "%tag%" >"%lib_path_dest%%lib_name%_%tag%.txt" - - -REM updating the googletest library -set lib_name=googletest -set lib_path_src=%base_path%%lib_name%\googletest\ -cd %lib_name% -set "tag=" -for /f %%i in ('git describe --contains HEAD') do set "tag=%%i" - -cd %base_path% -REM delete the destination library folder when updating -RD /S /Q "..\Libraries\%lib_name%" -set lib_path_dest=..\Libraries\%lib_name%\ -mkdir %lib_path_dest% - -mkdir "%lib_path_dest%Include" -mkdir "%lib_path_dest%Source" -REM when copying files for libzip exclude external lib files aes, crypto, xz, zstd, bzip2 -robocopy *.h %lib_path_src%include\gtest\ "%lib_path_dest%Include\gtest" /E -robocopy *.h %lib_path_src%src\ "%lib_path_dest%Include\src" -robocopy *.cc %lib_path_src%src\ "%lib_path_dest%Source" /XF *main* *all* - -echo "%tag%" >"%lib_path_dest%%lib_name%_%tag%.txt" \ No newline at end of file +for %%A in ("cpp-base64" "") do ( + if "%update_lib%"==%%A ( + set lib_name="cpp-base64" + set lib_path_src="!base_path!!lib_name!\" + + cd !lib_name! + set "tag=" + for /f %%i in ('git describe --contains HEAD') do set "tag=%%i" + + cd !base_path! + REM delete the destination library folder when updating + RD /S /Q "..\Libraries\!lib_name!" + set lib_path_dest="..\Libraries\!lib_name!\" + mkdir !lib_path_dest! + + mkdir "!lib_path_dest!Include" + mkdir "!lib_path_dest!Source" + copy !lib_path_src!base*.h "!lib_path_dest!Include" /Y + copy !lib_path_src!base*.cpp "!lib_path_dest!Source" /Y + + echo "!tag!" >"!lib_path_dest!!lib_name!_!tag!.txt" + ) +) + + +for %%A in ("fast_float" "") do ( + if "%update_lib%"==%%A ( + REM updating the fast_float library + set lib_name="fast_float" + set lib_path_src="!base_path!!lib_name!\" + + cd !lib_name! + set "tag=" + for /f %%i in ('git describe --contains HEAD') do set "tag=%%i" + + cd !base_path! + REM delete the destination library folder when updating + RD /S /Q "..\Libraries\!lib_name!" + set lib_path_dest="..\Libraries\!lib_name!\" + mkdir !lib_path_dest! + + mkdir "!lib_path_dest!Include" + copy !lib_path_src!include\!lib_name!\*.h "!lib_path_dest!Include" /Y + + echo "!tag!" >"!lib_path_dest!!lib_name!_!tag!.txt" + ) +) + + +for %%A in ("zlib" "") do ( + if "%update_lib%"==%%A ( + REM updating the zlib library + set lib_name="zlib" + set lib_path_src="!base_path!!lib_name!\" + + cd !lib_name! + set "tag=" + for /f %%i in ('git describe --contains HEAD') do set "tag=%%i" + + cd !base_path! + REM delete the destination library folder when updating + RD /S /Q "..\Libraries\!lib_name!" + set lib_path_dest="..\Libraries\!lib_name!\" + mkdir !lib_path_dest! + + mkdir "!lib_path_dest!Include" + mkdir "!lib_path_dest!Source" + copy !lib_path_src!*.h "!lib_path_dest!Include" /Y + copy !lib_path_src!*.c "!lib_path_dest!Source" /Y + + echo "!tag!" >"!lib_path_dest!!lib_name!_!tag!.txt" + ) +) + +for %%A in ("libzip" "") do ( + if "%update_lib%"==%%A ( + REM updating the libzip library + set lib_name=libzip + set lib_path_src=!base_path!!lib_name!\ + cd !lib_name! + set "tag=" + for /f %%i in ('git describe --contains HEAD') do set "tag=%%i" + + cd !base_path! + REM delete the destination library folder when updating + RD /S /Q "..\Libraries\!lib_name!" + set lib_path_dest=..\Libraries\!lib_name!\ + mkdir !lib_path_dest! + + mkdir "!lib_path_dest!Include" + mkdir "!lib_path_dest!Source" + REM when copying files for libzip exclude external lib files aes, crypto, xz, zstd, bzip2 + robocopy *.h !lib_path_src!lib\ "!lib_path_dest!Include" /XF *crypto* + robocopy *.c !lib_path_src!lib\ "!lib_path_dest!Source" /XF *crypto* *aes* *bzip2* *xz* *zstd* *win32* *unix* *stdio_named* *uwp* + + REM copy windows specific files to win and unix specific files to unix folders + mkdir "!lib_path_dest!Source\win" + mkdir "!lib_path_dest!Source\unix" + robocopy *win32*.c !lib_path_src!lib\ "!lib_path_dest!Source\win" + robocopy *unix*.c *stdio_named*.c !lib_path_src!lib\ "!lib_path_dest!Source\unix" + + REM generate autogenerated file using cmake script run + cd !lib_path_dest!Source\ + cmake -DPROJECT_SOURCE_DIR=!lib_path_src! -P !lib_path_src!cmake\GenerateZipErrorStrings.cmake + cd !base_path! + echo "!tag!" >"!lib_path_dest!!lib_name!_!tag!.txt" + ) +) + +for %%A in ("googletest" "") do ( + if "%update_lib%"==%%A ( + REM updating the googletest library + set lib_name=googletest + set lib_path_src=!base_path!!lib_name!\googletest\ + cd !lib_name! + set "tag=" + for /f %%i in ('git describe --contains HEAD') do set "tag=%%i" + + cd !base_path! + REM delete the destination library folder when updating + RD /S /Q "..\Libraries\!lib_name!" + set lib_path_dest=..\Libraries\!lib_name!\ + mkdir !lib_path_dest! + + mkdir "!lib_path_dest!Include" + mkdir "!lib_path_dest!Source" + REM when copying files for libzip exclude external lib files aes, crypto, xz, zstd, bzip2 + robocopy *.h !lib_path_src!include\gtest\ "!lib_path_dest!Include\gtest" /E /XD *custom* + robocopy *.h !lib_path_src!src\ "!lib_path_dest!Include\src" + robocopy *.cc !lib_path_src!src\ "!lib_path_dest!Source" /XF *main* *all* + + echo "!tag!" >"!lib_path_dest!!lib_name!_!tag!.txt" + ) +) \ No newline at end of file diff --git a/submodules/update_libs.sh b/submodules/update_libs.sh index 027009326..435d2b9b0 100644 --- a/submodules/update_libs.sh +++ b/submodules/update_libs.sh @@ -7,139 +7,156 @@ if [ ! -d "../Libraries/" ]; then mkdir "../Libraries" fi -# Updating the cpp-base64 library -lib_name="cpp-base64" -lib_path_src="$base_path$lib_name/" +update_all_libs=false -cd "$lib_name" -tag=$(git describe --contains HEAD) -cd "$base_path" +if [ -z "$1" ]; then + update_all_libs=true +fi -# Delete the destination library folder when updating -lib_path_dest="../Libraries/$lib_name/" -rm -rf "$lib_path_dest" -mkdir -p "$lib_path_dest" +# Updating the cpp-base64 library +if [[ "$1" == "cpp-base64" || "$update_all_libs" == true ]]; then + lib_name="cpp-base64" + lib_path_src="$base_path$lib_name/" -mkdir "$lib_path_dest/Include" -mkdir "$lib_path_dest/Source" -cp ${lib_path_src}base*.h "${lib_path_dest}Include" -cp ${lib_path_src}base*.cpp "${lib_path_dest}Source" + cd "$lib_name" + tag=$(git describe --contains HEAD) + cd "$base_path" -echo "\"$tag\"" > "$lib_path_dest${lib_name}_$tag.txt" + # Delete the destination library folder when updating + lib_path_dest="../Libraries/$lib_name/" + rm -rf "$lib_path_dest" + mkdir -p "$lib_path_dest" + mkdir "$lib_path_dest/Include" + mkdir "$lib_path_dest/Source" + cp ${lib_path_src}base*.h "${lib_path_dest}Include" + cp ${lib_path_src}base*.cpp "${lib_path_dest}Source" + echo "\"$tag\"" > "$lib_path_dest${lib_name}_$tag.txt" +fi -# Updating the fast_float library -lib_name="fast_float" -lib_path_src="$base_path$lib_name/" -cd "$lib_name" -tag=$(git describe --contains HEAD) -cd "$base_path" +# Updating the fast_float library +if [[ "$1" == "fast_float" || "$update_all_libs" == true ]]; then + lib_name="fast_float" + lib_path_src="$base_path$lib_name/" -# Delete the destination library folder when updating -lib_path_dest="../Libraries/$lib_name/" -rm -rf "$lib_path_dest" -mkdir -p "$lib_path_dest" + cd "$lib_name" + tag=$(git describe --contains HEAD) + cd "$base_path" -mkdir "$lib_path_dest/Include" -cp ${lib_path_src}include/$lib_name/*.h "${lib_path_dest}Include" + # Delete the destination library folder when updating + lib_path_dest="../Libraries/$lib_name/" + rm -rf "$lib_path_dest" + mkdir -p "$lib_path_dest" -echo "\"$tag\"" > "$lib_path_dest${lib_name}_$tag.txt" + mkdir "$lib_path_dest/Include" + cp ${lib_path_src}include/$lib_name/*.h "${lib_path_dest}Include" + echo "\"$tag\"" > "$lib_path_dest${lib_name}_$tag.txt" +fi # Updating the zlib library -lib_name="zlib" -lib_path_src="$base_path$lib_name/" +if [[ "$1" == "zlib" || "$update_all_libs" == true ]]; then + lib_name="zlib" + lib_path_src="$base_path$lib_name/" -cd "$lib_name" -tag=$(git describe --contains HEAD) -cd "$base_path" - -# Delete the destination library folder when updating -lib_path_dest="../Libraries/$lib_name/" -rm -rf "$lib_path_dest" -mkdir -p "$lib_path_dest" + cd "$lib_name" + tag=$(git describe --contains HEAD) + cd "$base_path" -mkdir "$lib_path_dest/Include" -mkdir "$lib_path_dest/Source" -cp ${lib_path_src}*.h "${lib_path_dest}Include" -cp ${lib_path_src}*.c "${lib_path_dest}Source" + # Delete the destination library folder when updating + lib_path_dest="../Libraries/$lib_name/" + rm -rf "$lib_path_dest" + mkdir -p "$lib_path_dest" -echo "\"$tag\"" > "$lib_path_dest${lib_name}_$tag.txt" + mkdir "$lib_path_dest/Include" + mkdir "$lib_path_dest/Source" + cp ${lib_path_src}*.h "${lib_path_dest}Include" + cp ${lib_path_src}*.c "${lib_path_dest}Source" + echo "\"$tag\"" > "$lib_path_dest${lib_name}_$tag.txt" +fi # Updating the libzip library -lib_name="libzip" -lib_path_src="$base_path$lib_name/" - -cd "$lib_name" -tag=$(git describe --contains HEAD) -cd "$base_path" +if [[ "$1" == "libzip" || "$update_all_libs" == true ]]; then + lib_name="libzip" + lib_path_src="$base_path$lib_name/" + + cd "$lib_name" + tag=$(git describe --contains HEAD) + cd "$base_path" + + # Delete the destination library folder when updating + lib_path_dest="../Libraries/$lib_name/" + rm -rf "$lib_path_dest" + mkdir -p "$lib_path_dest" + + mkdir "$lib_path_dest/Include" + mkdir "$lib_path_dest/Source" + find "${lib_path_src}lib" -name "*.h" \ + ! -name "*crypto*" \ + -exec cp {} "${lib_path_dest}Include" \; + + find "${lib_path_src}lib" -name "*.c" \ + ! -name "*crypto*" \ + ! -name "*aes*" \ + ! -name "*bzip2*" \ + ! -name "*xz*" \ + ! -name "*zstd*" \ + ! -name "*win32*" \ + ! -name "*unix*" \ + ! -name "*stdio_named*" \ + ! -name "*uwp*" \ + -exec cp {} "${lib_path_dest}Source" \; + + # copy windows specific files to win and unix specific files to unix folders + mkdir ${lib_path_dest}Source/win + mkdir ${lib_path_dest}Source/unix + + find "${lib_path_src}lib" -name "*win32*.c" \ + -exec cp {} "${lib_path_dest}Source/win" \; + + find "${lib_path_src}lib" \( -name "*unix*.c" -o -name "*stdio_named*.c" \) \ + -exec cp {} "${lib_path_dest}Source/unix" \; + + cd "${lib_path_dest}Source" + cmake -DPROJECT_SOURCE_DIR=${lib_path_src} -P ${lib_path_src}cmake/GenerateZipErrorStrings.cmake + cd "$base_path" + echo "\"$tag\"" > "$lib_path_dest${lib_name}_$tag.txt" +fi -# Delete the destination library folder when updating -lib_path_dest="../Libraries/$lib_name/" -rm -rf "$lib_path_dest" -mkdir -p "$lib_path_dest" - -mkdir "$lib_path_dest/Include" -mkdir "$lib_path_dest/Source" -find "${lib_path_src}lib" -name "*.h" \ - ! -name "*crypto*" \ - -exec cp {} "${lib_path_dest}Include" \; - -find "${lib_path_src}lib" -name "*.c" \ - ! -name "*crypto*" \ - ! -name "*aes*" \ - ! -name "*bzip2*" \ - ! -name "*xz*" \ - ! -name "*zstd*" \ - ! -name "*win32*" \ - ! -name "*unix*" \ - ! -name "*stdio_named*" \ - ! -name "*uwp*" \ - -exec cp {} "${lib_path_dest}Source" \; - -# copy windows specific files to win and unix specific files to unix folders -mkdir ${lib_path_dest}Source/win -mkdir ${lib_path_dest}Source/unix - -find "${lib_path_src}lib" -name "*win32*.c" \ - -exec cp {} "${lib_path_dest}Source/win" \; - -find "${lib_path_src}lib" \( -name "*unix*.c" -o -name "*stdio_named*.c" \) \ - -exec cp {} "${lib_path_dest}Source/unix" \; - -cd "${lib_path_dest}Source" -cmake -DPROJECT_SOURCE_DIR=${lib_path_src} -P ${lib_path_src}cmake/GenerateZipErrorStrings.cmake -cd "$base_path" -echo "\"$tag\"" > "$lib_path_dest${lib_name}_$tag.txt" +if [[ "$1" == "googletest" || "$update_all_libs" == true ]]; then + # updating the googletest library + lib_name="googletest" + lib_path_src="$base_path$lib_name/googletest/" -# updating the googletest library -lib_name="googletest" -lib_path_src="$base_path$lib_name/googletest/" + cd "$lib_name" + tag=$(git describe --contains HEAD) + cd "$base_path" -cd "$lib_name" -tag=$(git describe --contains HEAD) -cd "$base_path" + # Delete the destination library folder when updating + lib_path_dest="../Libraries/$lib_name/" + rm -rf "$lib_path_dest" + mkdir -p "$lib_path_dest" -# Delete the destination library folder when updating -lib_path_dest="../Libraries/$lib_name/" -rm -rf "$lib_path_dest" -mkdir -p "$lib_path_dest" + mkdir "$lib_path_dest/Include" + mkdir "$lib_path_dest/Include/gtest" + mkdir "$lib_path_dest/Include/gtest/internal" + mkdir "$lib_path_dest/Source" + mkdir "$lib_path_dest/Include/src" -mkdir "$lib_path_dest/Include" -mkdir "$lib_path_dest/Source" -mkdir "$lib_path_dest/Include/src" + cp ${lib_path_src}include/gtest/*.h "${lib_path_dest}Include/gtest" -cp -r "${lib_path_src}include/gtest/" "${lib_path_dest}Include/" + cp ${lib_path_src}include/gtest/internal/*.h "${lib_path_dest}Include/gtest/internal" -find "${lib_path_src}src/" -name "*.h" \ - -exec cp {} "${lib_path_dest}Include/src" \; + find "${lib_path_src}src/" -name "*.h" \ + -exec cp {} "${lib_path_dest}Include/src" \; -find "${lib_path_src}src/" -name "*.cc" \ - ! -name "*all*" \ - ! -name "*main*" \ - -exec cp {} "${lib_path_dest}Source" \; + find "${lib_path_src}src/" -name "*.cc" \ + ! -name "*all*" \ + ! -name "*main*" \ + -exec cp {} "${lib_path_dest}Source" \; -echo "\"$tag\"" > "$lib_path_dest${lib_name}_$tag.txt" \ No newline at end of file + echo "\"$tag\"" > "$lib_path_dest${lib_name}_$tag.txt" +fi \ No newline at end of file