Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mockcpp does not build against latest googletest 1.13 #48

Open
cshaw-identiv opened this issue Jun 6, 2023 · 0 comments
Open

mockcpp does not build against latest googletest 1.13 #48

cshaw-identiv opened this issue Jun 6, 2023 · 0 comments

Comments

@cshaw-identiv
Copy link

The main branch of mockcpp does not build against the latest version of googletest (v1.13 onwards) when specifying gtest as the unit test framework. The build fails when building ports/failure/gtest_report_failure.cpp.o because the included gtest.h forces an error with a message about the compiler being required to support C++14.

This was seen on Windows, using both cygwin and WSL Ubuntu.

This error occurs because the mockcpp build enforces c++11 compilation. The relevant code is in src/CMakeLists.txt::83:

IF(MSVC)
    ADD_DEFINITIONS(-DMSVC_VMG_ENABLED) #  /Z7)
    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /vmg")
	INCLUDE_DIRECTORIES(BEFORE ${MOCKCPP_SRC_ROOT}/3rdparty/msinttypes)
ELSE(MSVC)
    ADD_DEFINITIONS(-std=c++11)
ENDIF(MSVC)

When the -std flag is removed, the latest version of googletest builds without problem.
Presumably the enforcing -std flag is there for a reason, but can it be either removed completely, or removed for gtest dependency?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant