Ensure GoogleTest builds properly
authorMark Abraham <mark.j.abraham@gmail.com>
Fri, 5 Feb 2021 14:13:57 +0000 (15:13 +0100)
committerPaul Bauer <paul.bauer.q@gmail.com>
Fri, 5 Feb 2021 16:16:06 +0000 (16:16 +0000)
Some test targets would not build without this.

Closes #3890

src/external/CMakeLists.txt

index e850736ec45f0a4c378bb7cea7d87b0b29b8c2da..57f73c60d0e3247a737c8a64f3a47f5eeccdd8d1 100644 (file)
@@ -61,8 +61,9 @@ if(BUILD_TESTING AND GMX_BUILD_UNITTESTS)
             )
     target_compile_definitions(gtest PUBLIC GTEST_LANG_CXX11)
     if (CYGWIN)
-        # Ensure GoogleTest can find POSIX things it needs
-        target_compile_definitions(gtest PRIVATE _POSIX_C_SOURCE=200809L)
+        # Ensure GoogleTest and things that use it can find
+        # POSIX things needed by GoogleTest
+        target_compile_definitions(gtest PUBLIC _POSIX_C_SOURCE=200809L)
     endif()
     gmx_target_warning_suppression(gmock -Wno-deprecated-copy HAVE_NO_DEPRECATED_COPY)