summaryrefslogtreecommitdiffstats
path: root/googletest/cmake
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #4293 from juan-lunarg:juan/fix_remaining_cmake_versionCopybara-Service2023-06-211-51/+21
|\ | | | | | | | | PiperOrigin-RevId: 542299863 Change-Id: I51cf4a4f8d6a97e39e6c46f48fa6acf3bd0ab6b5
| * cmake: Remove remaining checks for CMAKE_VERSIONrefs/pull/4293/headJuan Ramos2023-06-211-49/+19
|/ | | | Remove conditional code that doesn't need to exist anymore.
* cmake: Clean up policy coderefs/pull/4290/headJuan Ramos2023-06-201-14/+0
| | | | | | | | | | Now that the min is 3.13 these policies don't need to be set manually anymore. CMP0054 - 3.1 CMP0063 - 3.3 CMP0069 - 3.9 CMP0077 - 3.13
* Merge pull request #4188 from Mizzrym1:componentCopybara-Service2023-06-121-0/+4
|\ | | | | | | | | PiperOrigin-RevId: 539684886 Change-Id: Ie7f4175ad413fdb82d265374a4aca9fad23571f5
| * Add COMPONENT to installrefs/pull/4188/headMaciej Sroczyński2023-03-141-0/+4
| |
* | Merge pull request #4256 from niranjan-nilakantan:niranjan-nilakantan/issue4255Copybara-Service2023-05-301-2/+12
|\ \ | | | | | | | | | | | | PiperOrigin-RevId: 536480185 Change-Id: I9bdd65cd18253703abf3cc92b3f354c1f798aa3e
| * | Disable some warnings for IntelLLVM on Windows.refs/pull/4256/headniranjan2023-05-251-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use /fp:precise to override IntelLLVM's default of /fp:fast. This makes IsInf and IsNan work as expected by googletest. ``` [build]...\googletest\googlemock\test\gmock-function-mocker_test.cc(143,21): error: 'VoidReturning' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override] [build] MOCK_METHOD(void, VoidReturning, (int n)); // NOLINT ``` ``` [build] ...\googletest\googlemock\test\gmock-function-mocker_test.cc(182,20): error: exception specification of overriding function is more lax than base version [-Werror,-Wmicrosoft-exception-spec] [build] MOCK_METHOD(int, CTNullary, (), (Calltype(STDMETHODCALLTYPE))); ``` ``` [build] ...\googletest\googletest\test\googletest-death-test-test.cc(209,5): error: unused function 'DieInCRTDebugElse12' [-Werror,-Wunused-function] [build] int DieInCRTDebugElse12(int* sideeffect) { [build] ^ ``` ``` [build] ...\googletest\googletest\test\gtest_unittest.cc(4096,7): error: variable 'n' set but not used [-Werror,-Wunused-but-set-variable] [build] int n = 0; ```
| * | Build googletest with IntelLLVM compilers.Niranjan Nilakantan2023-05-241-2/+8
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the same flags as Clang if the compiler id is IntelLLVM. IntelLLVM warns if a double constant is assigned to a float. ``` [build] .../googletest/googletest/include/gtest/gtest-printers.h:516:17: warning: implicit conversion between floating point types of different sizes [-Wimplicit-float-size-conversion] [build] mulfor6 = 1e1; ``` IntelLLVM uses fp-model=fast by default, breaking IsNan and IsInf tests. Use -ffp-model=precise to fix this. IntelLLVM does not support -Wchar-subscripts Fixes #4255
* | Merge pull request #4157 from dpogue:patch-1Copybara-Service2023-03-201-0/+4
|\ \ | |/ |/| | | | | PiperOrigin-RevId: 518065122 Change-Id: I3a71c85626050b9aecebd4aa10d668ea3c48c82c
| * Set CMP0069 policy to avoid warningsrefs/pull/4157/headDarryl Pogue2023-02-181-0/+4
| | | | | | | | | | When googletest and googlemock are included as a git submodule and referenced as part of an existing CMake project, multiple warnings are printed out due to not setting a value for the CMP0069 policy.
* | Fix compilation with -Wundef.Tom Hughes2023-03-061-2/+2
|/ | | | | | | Fixes #3267 PiperOrigin-RevId: 513946600 Change-Id: I0dd1daa04aeb735a238c4c0af6676565d64cbc21
* Build gmock Python tests when building with cmakeTom Hughes2023-02-011-2/+4
| | | | | | | Fixes #4124. PiperOrigin-RevId: 506379032 Change-Id: Ibc44ffce1012bbf313565728a3d9e5e6e56ba660
* Makes Clang compilations via Ninja on Windows define _DLL only for shared ↵Abseil Team2022-10-051-2/+7
| | | | | | | CRT builds, as one would already expect from MSVC builds. (Previously, static Clang/Ninja builds on Windows also implicitly defined _DLL, which was problematic.) PiperOrigin-RevId: 479113168 Change-Id: I252d9be90fd33df75dab922e62b197208830d124
* Merge pull request #3940 from anpol:pdb-static-libCopybara-Service2022-07-181-1/+2
|\ | | | | | | | | PiperOrigin-RevId: 461703446 Change-Id: I61773eafa6d6bf6294218a5117fdebf5dd8a7bb1
| * cmake: make PDB output directory match that of a static library.refs/pull/3940/headAndrei Polushin2022-07-121-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PDB files should be created at the same location as their primary artifact, which is either static library or a DLL. On Windows, an artifact location is controlled by: * RUNTIME_OUTPUT_DIRECTORY is a directory of a DLL artifact. * ARCHIVE_OUTPUT_DIRECTORY is a directory of a LIB artifact. A PDB file location is controlled: * PDB_OUTPUT_DIRECTORY should match a directory of a DLL artifact. * COMPILE_PDB_OUTPUT_DIRECTORY should match a directory of a LIB artifact.
* | cmake: find python in order specified by PATH environment variable.refs/pull/3939/headAndrei Polushin2022-07-121-0/+6
|/ | | | | | | | | | | | | | | CMake policy CMP0094 controls a lookup strategy used to find a Python executable: * CMP0094=OLD selects a Python executable with a higher version. * CMP0094=NEW selects a Python executable found earlier in PATH. NEW behavior is critical in presence of a Python virtual environment established and activated, i.e. added to the PATH variable. In case GoogleTest is embedded into a larger project, the result of `find_package(Python)` affects the whole build, not only GoogleTest component itself.
* Merge pull request #3844 from akohlmey:intel-llvm-utf8-fixCopybara-Service2022-07-111-1/+3
|\ | | | | | | | | PiperOrigin-RevId: 460222266 Change-Id: I2fbeac0b333ca16639f172ca1f23794ea9ddc2ad
| * set -utf-8 flag only for real MSVC compilers. E.g. not Intel's icx.exerefs/pull/3844/headAxel Kohlmeyer2022-05-181-1/+3
| |
* | CMake: raise the default C++ standard to cxx_std_14Derek Mauro2022-07-081-1/+1
|/ | | | | PiperOrigin-RevId: 459761499 Change-Id: Ifb4b8b9f2dc598f3f4afc66a9efc403e001e0262
* FIX #2174 -- remove `DEBUG_POSTFIX`refs/pull/3732/headAyush Joshi2022-01-131-4/+0
| | | | | | | | while this is not synced with the pkg-config file, it only breaks things Fix #2174 Signed-off-by: Ayush Joshi <ayush854032@gmail.com>
* Makes the Python imports consistently use full paths from the repository root,Derek Mauro2021-12-221-0/+2
| | | | | | | | | unifying the behavior between Bazel and CMake This fixes one of the CI failures on Windows PiperOrigin-RevId: 417872531 Change-Id: I156989323b7e6d4a4420f4f9691b078829db933d
* Googletest exportdmauro2021-06-221-2/+2
| | | | | | | | | | | | | | | Remove -Werror from the CMake compiler flags We should not force warnings as errors on users. Sometimes compilers introduce new warnings which will break builds. Instead, we manually turn this flag on in our continuous integration scripts so we can catch these errors, but not force them on our users. Fixes #3447 PiperOrigin-RevId: 380241852
* Merge pull request #3155 from ZedThree:cmake-alias-librariesDino Radaković2021-03-301-0/+1
|\ | | | | | | PiperOrigin-RevId: 365572439
| * CMake: Add namespaced ALIAS libraryrefs/pull/3155/headPeter Hill2020-12-041-0/+1
| | | | | | | | Fixes #3125
* | Googletest exportAbseil Team2021-03-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Print std::u8string, std::u16string, and std::u32string as string literals Previously, these types were printed as "{ U+123, U+456, U+789 }". However, printed output in that form is difficult to compare against any literals that might be defined in code. Instead, just treat these types like std::string and std::wstring, escaping non-ASCII characters with a hexadecimal escape sequence. The tests have also been updated to cover the new functionality: as a bonus, the tests now also pass with the MSVC toolchain. Internally, the code has been reorganized to primarily operate in terms of char32_t, under the assumption that char32_t will always be at least as big as wchar_t. While that assumption is currently true, perhaps it won't be in the future... PiperOrigin-RevId: 364033132
* | remove -Zi from MSVC compiler optionsrefs/pull/3291/headBe2021-02-261-1/+1
|/ | | | | | | | | | | This is incompatible with compiler caches such as sccache and clcache. If a project including Google Test specifies /Z7 instead, building fails with: sccache C:\PROGRA~2\MICROS~1\2019\ENTERP~1\VC\Tools\MSVC\1428~1.293\bin\Hostx64\x64\cl.exe /nologo /TP -D__SSE2__ -D__SSE__ -I..\lib\googletest-1.10.x\googlemock\include -I..\lib\googletest-1.10.x\googlemock -I..\lib\googletest-1.10.x\googletest\include -I..\lib\googletest-1.10.x\googletest /DWIN32 /D_WINDOWS /W4 /GR /MD /Z7 /O2 /Ob1 /DNDEBUG -GS -W4 -WX -wd4251 -wd4275 -nologo -J -Zi -D_UNICODE -DUNICODE -DWIN32 -D_WIN32 -DSTRICT -DWIN32_LEAN_AND_MEAN -wd4702 -DGTEST_HAS_PTHREAD=0 -EHsc -D_HAS_EXCEPTIONS=1 /Gy /showIncludes /Folib\googletest-1.10.x\googlemock\CMakeFiles\gmock_main.dir\src\gmock-all.cc.obj /Fdbin\gmock_main.pdb /FS -c ..\lib\googletest-1.10.x\googlemock\src\gmock-all.cc FAILED: lib/googletest-1.10.x/googlemock/CMakeFiles/gmock_main.dir/src/gmock-all.cc.obj ..\lib\googletest-1.10.x\googletest\src\gtest-all.cc: fatal error C1041: cannot open program database 'D:\a\mixxx\mixxx\build\bin\gmock_main.pdb'; if multiple CL.EXE write to the same .PDB file, please use /FS cl : Command line warning D9025 : overriding '/Z7' with '/Zi'
* Merge pull request #3114 from marbre:FindPythonGennadiy Rozental2020-11-241-1/+7
|\ | | | | | | PiperOrigin-RevId: 342977338
| * Refactor finding pythonrefs/pull/3114/headMarius Brehler2020-11-111-1/+7
| | | | | | | | | | Use `find_package(Python ..)` if available, instead of the deprecated `find_package(PythonInterp)` CMake module.
* | Googletest exportdmauro2020-11-121-36/+9
|/ | | | | | | | | | | | Rollback change from https://github.com/google/googletest/pull/1836. This change generates a script on Windows to actually run each test, but the script itself doesn't correctly report if the test passed. This change will "break tests" that were already broken on Windows, but weren't being reported as such. PiperOrigin-RevId: 341850671
* use target_compile_features to use c++11 if cmake > 3.8refs/pull/2808/headOlivier Ldff2020-07-021-0/+4
| | | | | If target_compile_features is available and cxx_std_11. This fix compilation with clang and gcc when c++11 isn't specified by user.
* Ensure that gtest/gmock pkgconfig requirements specify versionrefs/pull/2756/headNeal Gompa2020-03-211-1/+1
| | | | | | | | | Google Test and Google Mock require matching versions to work, so this requirement should be described in the pkgconfig files. This change is derived from the one used for the Fedora gtest package. Signed-off-by: Neal Gompa <ngompa13@gmail.com>
* Merge pull request #2556 from ienorand:avoid-pkg-config-lpthread-cflagAndy Getz2019-11-132-2/+2
|\ | | | | | | PiperOrigin-RevId: 279375858
| * pkg-config: Remove pthread link flag from Cflagsrefs/pull/2556/headMartin Erik Werner2019-11-052-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Remove the threads link library variable references from the pkg-config Cflags: field, removing -lpthread(s) from the compile flags. "-l*" linker flags should only be part of the Libs: section and should not be part of the Cflags: section in pkg-config files. This was first suggested in https://github.com/google/googletest/pull/2006 and further discussed in https://github.com/google/googletest/pull/2483 .
* | Revert "Use pcfiledir for prefix in pkgconfig file"David Seifert2019-10-052-6/+4
|/ | | | | | | | The change makes implicit assumptions on the layout of the install tree, which is going to break in many ways. The correct solution is to use the `PKG_CONFIG_SYSROOT_DIR` variable to inject the cross-compiled sysroot into `-I` and `-L` paths.
* Setting CMP0054 policy to NEW. This allows to use the string "SHARED" ↵refs/pull/2283/headMatthias Walter2019-06-121-0/+4
| | | | without interpreting it as a variable.
* clang: fix `-Wsign-conversion` errorsEnji Cooper2019-04-061-1/+1
| | | | | | | | | | | Cast some values as their unsigned equivalents or `size_t` to match the parameter type used for the template object under test. Also, provide UInt32 equivalent delegate methods for some callers (with int-equivalents for backwards compatibility). This closes #2146. Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
* Merge pull request #2148 from ngie-eign:clang-add-explicit-c++11-rtti-flagGennadiy Civil2019-04-051-0/+1
|\ | | | | | | PiperOrigin-RevId: 242038269
| * clang: explicitly enable/disable RTTI support with the compilerEnji Cooper2019-04-041-1/+2
|/ | | | | | | | | | | | | | | | | | | | Add `-frtti` to the compiler with the base flags case so that RTTI is enabled by default with clang. Add its inverse analog, `cxx_no_rtti_flags` in order to test the case with RTTI off, similar to gcc. This reduces the amount of testing/support overhead needed in the non-RTTI case with clang, as the tests currently fail when these two features are off with version 1.8.1. This something I used in when investigating test failures on FreeBSD, as the tests that rely on RTTI were failing with googletest 1.8.1 on the OS platform. More investigation is being done to determine how this should be fixed on FreeBSD 11.2-RELEASE with ports, as the package doesn't currently compile the tests, and when enabled (based on my WIP diff), the tests fail in similar ways. Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
* Merge pull request #2126 from ngie-eign:clang-add-more-strict-warningsGennadiy Civil2019-02-221-0/+1
|\ | | | | | | PiperOrigin-RevId: 235220570
| * Add `cxx_strict_flags` for clang to match FreeBSD's WARNS flagsEnji Cooper2019-02-131-0/+1
| | | | | | | | Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
* | Ignore `-Wsign-conversion` issuesrefs/pull/2137/headEnji Cooper2019-02-191-1/+1
|/ | | | | | | | | | clang++ compilation when `-Wsign-conversion` is currently broken and the issues within the code are varied and widespread. For the time being ignore `-Wsign-conversion` issues, even though some of them are valid and bleed over into issues that would be found with `-Wtautological-compare`, et al. Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
* Merge pull request #2114 from knuto:pr/libtool_supportGennadiy Civil2019-02-131-0/+21
|\ | | | | | | PiperOrigin-RevId: 233773676
| * Generate a libgtest.la to help libtool managing dependenciesrefs/pull/2114/headKnut Omang2019-02-111-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When building and using googletest from an install tree we want libtool to generate rpath in the dependent binaries to allow them to be executed from a build without a need for LD_LIBRARY_PATH or similar. For libtool based project this happens automatically as projects generates .la files and install them. Provide such a file for gtest as well to allow it to work smoothly with libtool based projects. Signed-off-by: Knut Omang <knut.omang@oracle.com>
* | Compile clang with `-Wall -Wshadow -Werror`refs/pull/2120/headEnji Cooper2019-02-131-0/+4
|/ | | | | | It was not compiling any of the code with warnings prior to this. Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
* Avoid dynamic/static runtime linking (LNK4098) by properly replacing ↵refs/pull/2086/headHugo Lindström2019-01-281-0/+2
| | | | MD(d)->MT(d) in both C and CXX flags, resolves 2074
* Googletest exportmisterg2018-12-132-2/+2
| | | | | | Internal Change PiperOrigin-RevId: 225231727
* Issue #1955: Remove THREADS_PREFER_PTHREAD_FLAGrefs/pull/1977/headLukas Mosimann2018-11-221-1/+0
|
* Googletest exportmisterg2018-11-202-2/+2
| | | | | | Internal Change PiperOrigin-RevId: 222123106
* Add back warning suppression that shouldn't have been removedrefs/pull/1959/headRobin Lindén2018-11-101-0/+3
|
* Remove workarounds for unsupported MSVC versionsRobin Lindén2018-11-101-26/+1
|