-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Kill /NODEFAULTLIB warnings when compiling tests under MSVC in debug
They were caused by gtest/gmock statically linking to the release runtime in debug mode. The fix has required patching gmock/CMakeLists & gtest/CMakeLists to remove hard-coded /MD switch. This patch has already been incorporated in to gmock 1.7.0 but we cannot upgrade since this does not compile with the std=c++0x flag on gcc. Refs #8408
- Loading branch information
1 parent
6f3b667
commit 92a54f5
Showing
3 changed files
with
19 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
#add_subdirectory( gtest-1.6.0 ) | ||
if( MSVC ) | ||
# We are building static libraries but we want them to dynamically link | ||
# the to C/C++ runtime or we get duplicate library warnings | ||
set ( gtest_force_shared_crt ON ) | ||
endif() | ||
add_subdirectory( gmock-1.6.0 ) | ||
|
||
set_target_properties( gmock PROPERTIES EXCLUDE_FROM_ALL TRUE ) | ||
set_target_properties( gtest PROPERTIES EXCLUDE_FROM_ALL TRUE ) | ||
# Put the targets in the UnitTests folder | ||
foreach( target_var | ||
gmock gtest ) | ||
set_target_properties( ${target_var} PROPERTIES EXCLUDE_FROM_ALL TRUE | ||
FOLDER "UnitTests/gmock" ) | ||
endforeach() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters