Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
googletest
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
googletest
Commits
28bb854c
Commit
28bb854c
authored
Aug 02, 2017
by
Gennadiy Civil
Committed by
GitHub
Aug 02, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1042 from danilcha/patch-1
Added description of how to silence clang pedantic warnings in Google Mock includes
parents
fa388e9f
5ff68057
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
3 deletions
+36
-3
README.md
googlemock/README.md
+36
-3
No files found.
googlemock/README.md
View file @
28bb854c
...
@@ -125,13 +125,46 @@ build Google Mock and its tests, which has further requirements:
...
@@ -125,13 +125,46 @@ build Google Mock and its tests, which has further requirements:
### Building Google Mock ###
### Building Google Mock ###
#### Using CMake ####
If you have CMake available, it is recommended that you follow the
If you have CMake available, it is recommended that you follow the
[
build instructions
][
gtest_cmakebuild
]
[
build instructions
][
gtest_cmakebuild
]
as described for Google Test. If are using Google Mock with an
as described for Google Test.
If are using Google Mock with an
existing CMake project, the section
existing CMake project, the section
[
Incorporating Into An Existing CMake Project
][
gtest_incorpcmake
]
[
Incorporating Into An Existing CMake Project
][
gtest_incorpcmake
]
may be of particular interest. Otherwise, the following sections
may be of particular interest.
detail how to build Google Mock without CMake.
To make it work for Google Mock you will need to change
target_link_libraries(example gtest_main)
to
target_link_libraries(example gmock_main)
This works because
`gmock_main`
library is compiled with Google Test.
However, it does not automatically add Google Test includes.
Therefore you will also have to change
if (CMAKE_VERSION VERSION_LESS 2.8.11)
include_directories("${gtest_SOURCE_DIR}/include")
endif()
to
if (CMAKE_VERSION VERSION_LESS 2.8.11)
include_directories(BEFORE SYSTEM
"${gtest_SOURCE_DIR}/include" "${gmock_SOURCE_DIR}/include")
else()
target_include_directories(gmock_main SYSTEM BEFORE INTERFACE
"${gtest_SOURCE_DIR}/include" "${gmock_SOURCE_DIR}/include")
endif()
This will addtionally mark Google Mock includes as system, which will
silence compiler warnings when compiling your tests using clang with
`-Wpedantic -Wall -Wextra -Wconversion`
.
#### Preparing to Build (Unix only) ####
#### Preparing to Build (Unix only) ####
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment