Commit Graph

29 Commits

Author SHA1 Message Date
David Korth
440bb7aeb5 Increase minimum CMake versions to "3.5...3.10".
CMake 4.0 drops compatibility with versions older than 3.5, and warns
that compatibility with < 3.10 will be dropped in a "future version".

CMake 3.30 previously warned about dropping support for older than
3.5, which was changed in 3.31 to older than 3.10.
2025-05-25 15:39:40 -04:00
David Korth
2edf38d985 [googletest] Don't use the gcc-4.9 workaround if building with clang.
Not sure why this is getting triggered in the clang/arm64 build, since clang
doesn't define __GNUG__...
2025-02-18 18:36:48 -05:00
David Korth
fe163149b9 [googletest] Disable gtest_main and gmock_main.
The recent PIC changes for the internal TinyXML2 somehow broke compiling
gtest_main on Windows:

extlib\googletest\googletest\src\gtest_main.cc(48): error C2491: 'main':
    definition of dllimport function not allowed

Also disable gmock_main, since it depends on gtest_main.

We aren't actually using these, so it's not an issue.
(We implement our own main() in gtest_init.cpp.)

[extlib] CMakeLists.txt: Rename SET_EXTLIB_PROPERTIES_PIC() to
SET_EXTLIB_PROPERTIES_PIC_ONLY(), since SET_EXTLIB_PROPERTIES()
also sets POSITION_INDEPENDENT_CODE=TRUE.

Also use SET_EXTLIB_PROPERTIES_PIC_ONLY() for shared libraries that
may be installed, since we can't use SET_EXTLIB_PROPERTIES().
2025-01-11 12:30:51 -05:00
David Korth
589e71670e [googletest] Add workaround to fix the build on Debian 8. (gcc-4.9)
gcc-4.9 doesn't support std::is_trivially_copy_constructible<T> or
std::is_trivially_destructible<T>, so use __has_trivial_copy(T)
and __has_trivial_destructor(T) on old gcc.

It's not a perfect fix, but it gets the code to compile.

(I'm using Debian 8 to test big-endian using qemu-system-ppc.
Surprisingly, it's faster than Wii U Linux, even with all of
the CPU emulation overhead!)
2024-03-10 01:44:38 -05:00
David Korth
d9508735fb [googletest] library.json: Removed this file.
It was removed sometime between v1.11.0 and v1.12.0.
2023-08-12 15:18:13 -04:00
David Korth
b9dd3ed661 [googletest] CMakeLists.txt: Fix gtest's PDB filename in debug builds.
CMAKE_DEBUG_POSTFIX wasn't being set, so the PDB filename ended up being
gtestpdb_debug_postfix-NOTFOUND.pdb.

Set CMAKE_DEBUG_POSTFIX="d" and CMAKE_RELEASE_POSTFIX="" when building
with MSVC. For other compilers, both are set to "".
2023-07-16 18:47:04 -04:00
David Korth
0fde77d02f [googletest] Update: 1.11.0 -> 1.12.1
Remove the ci/ directory since it isn't needed.
2022-07-04 13:53:31 -04:00
David Korth
a646f68b06 [googletest] Update: 1.10.0 -> 1.11.0
Remove more testsuite files, since they aren't needed.
2021-06-27 02:10:30 -04:00
David Korth
c31c512bf9 [googletest] gtest-death-test.cc: Initialize dummy variables to 0.
gcc-11.1 complained about uninitialized variables, and googletest has
-Werror specified:

In file included from ../../extlib/googletest/googletest/src/gtest-all.cc:42:
../../extlib/googletest/googletest/src/gtest-death-test.cc: In function ‘bool testing::internal::StackGrowsDown()’:
../../extlib/googletest/googletest/src/gtest-death-test.cc:1301:24: error: ‘dummy’ may be used uninitialized [-Werror=maybe-uninitialized]
 1301 |   StackLowerThanAddress(&dummy, &result);
      |   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
../../extlib/googletest/googletest/src/gtest-death-test.cc:1290:13: note: by argument 1 of type ‘const void*’ to ‘void testing::internal::StackLowerThanAddress(const void*, bool*)’ declared here
 1290 | static void StackLowerThanAddress(const void* ptr, bool* result) {
      |             ^~~~~~~~~~~~~~~~~~~~~
../../extlib/googletest/googletest/src/gtest-death-test.cc:1299:7: note: ‘dummy’ declared here
 1299 |   int dummy;
      |       ^~~~~
cc1plus: all warnings being treated as errors
2021-04-28 01:32:12 -04:00
David Korth
4fb1a650a7 [googletest] Don't include debugapi.h, since it's not available when using MSVC's v140_xp toolset.
It's implicitly included by windows.h in newer SDKs.
2020-08-13 00:00:49 -04:00
David Korth
e2d592de91 [googletest] Remove MSVC 2013 compatibility fixes; switch AppVeyor to MSVC 2015.
Some of the stuff simply can't be fixed, so we'll use MSVC 2015.

Note that this means the test suite won't be usable with older versions
of MSVC.
2020-08-12 21:25:46 -04:00
David Korth
75164f59c4 [googletest] gtest-internal.h: Attempt to fix Indices on MSVC 2013, again. 2020-08-12 20:32:41 -04:00
David Korth
d4d1b6b306 [googletest] gtest-internal.h: s/Incides/Indices/ 2020-08-01 01:35:38 -04:00
David Korth
9c26fd5d22 [googletest] Two more MSVC 2013 fixes.
- #include <debugapi.h> on MSVC 2015 and later only.
- `using =` is only supported on MSVC 2015 and later.
2020-08-01 01:34:42 -04:00
David Korth
843b207d02 [googletest] Disable noexcept and -WX on MSVC 2013. 2020-08-01 00:45:16 -04:00
David Korth
2b9595ba99 [googletest] gtest-matchers.h: MSVC 2013 doesn't support default move constructors. 2020-08-01 00:31:31 -04:00
David Korth
9d42ab3ec5 [googletest] Restored _MODIFIED_GTEST.txt and updated for v1.10.0. 2020-08-01 00:00:40 -04:00
David Korth
0ee4c70cf3 [googletest] Fix build issues with MSVC 2013.
- [[noreturn]] isn't supported; use __declspec(noreturn).

- constexpr isn't supported.
2020-07-31 23:59:15 -04:00
David Korth
5a1b4d1be0 [googletest] Updated to v1.10.0.
Now requires C++ 2011.
2020-07-30 19:39:43 -04:00
David Korth
114cb78a1e [googletest] Removed test suites, scripts, and Xcode projects in order to reduce warnings on LGTM. 2018-12-30 16:38:18 -05:00
David Korth
784ef57097 [googletest] Updated to v1.8.1. 2018-09-30 17:52:15 -04:00
David Korth
736511c8af [googletest] CMakeLists.txt: Don't set CMP0063 if using cmake earlier than 3.3.0.
CMake complains if we set a policy that it doesn't know about.
2017-01-01 16:01:05 -05:00
David Korth
614ab793ec Don't apply hidden visibility settings to extlib.
This causes zlib, libpng, and possibly others to not export any symbols
in either the .a or .so on Linux, which makes them unusable.

CheckHiddenVisibility.cmake: New macro CHECK_HIDDEN_VISIBILITY().
Use this in the upper-level source directory to apply hidden visibility
to all subprojects. Used in src/CMakeLists.txt.
2017-01-01 15:48:31 -05:00
David Korth
45491b4661 Simplify the Google Test build infrastructure a bit.
libromdata/tests/CMakeLists.txt:
- Link to gtest directly instead of ${GTEST_LIBRARY}.
- Removed INCLUDE_DIRECTORIES() for googletest, since it's added to
  TARGET_INCLUDE_DIRECTORIES() by googletest's CMakeLists.txt.

extlib/googletest/googletest/CMakeLists.txt:
- Uncommented gtest_hide_internal_symbols.

Removed cmake/gtest.cmake, since it doesn't have anything useful other
than INCLUDE(CTest), which is now present in the top-level CMakeLists.txt.
2016-09-14 23:18:20 -04:00
David Korth
ed7171854c [googletest] Disabled cmake_minimum_required().
This interfered with setting CMake policy CMP0063.
2016-09-05 23:12:59 -04:00
David Korth
480675a5ea [extlib] Add CMakeLists.txt and googletest/_MODIFIED_GTEST.txt.
I really need to check for untracked files before committing.
2016-09-02 22:58:29 -04:00
David Korth
4c65f452c7 [googletest] Force static library builds. 2016-09-02 22:57:44 -04:00
David Korth
8c8a444f7b [googletest] Disabled INSTALL() rules.
We aren't installing googletest or googlemock, and because we're setting
EXCLUDE_FROM_ALL, cmake complains about the INSTALL() rules.
2016-09-02 22:23:31 -04:00
David Korth
ddbfadd715 [gtest] Initial import of Google Test 1.8.0.
Google Test will be used for implementing unit tests. The first set of
unit tests will be for testing RpPng with various PNG image formats.

The Google Test code is currently identical to the release archive,
except for the removal of .travis.yml and appveyor.xml.

CMakeLists.txt: Added CTest support. (see cmake/gtest.cmake)

extlibs/CMakeLists.txt: Only build googletest libraries if testing is
enabled and some project depends on them.
2016-09-02 21:01:52 -04:00