Skip to content

Build Warning on Windows with Clang due to -Wundef Flag #4372

Closed
@KlassenH

Description

@KlassenH

Describe the issue

Using the Clang compiler on Windows via Visual Studio to build the form produces these warnings:

...\build\x64-debug\_deps\googletest-src\googletest\include\gtest\internal\gtest-port.h(830,5): warning GC893BB5A: 'GTEST_LINKED_AS_SHARED_LIBRARY' is not defined, evaluates to 0 [-Wundef]
  #if GTEST_LINKED_AS_SHARED_LIBRARY
      ^
...\build\x64-debug\_deps\googletest-src\googletest\include\gtest\internal\gtest-port.h(832,7): warning G3FA67CA8: 'GTEST_CREATE_SHARED_LIBRARY' is not defined, evaluates to 0 [-Wundef]
  
  #elif GTEST_CREATE_SHARED_LIBRARY
  
        ^

Steps to reproduce the problem

CMakeLists.txt

What version of GoogleTest are you using?

f8d7d77

What operating system and version are you using?

Windows 11

What compiler and version are you using?

clang version 16.0.5
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\Llvm\x64\bin

What build system are you using?

cmake version 3.26.4-msvc4

Additional context

No response

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions