Introduces gtest_force_shared_crt option for CMake build scripts.
This commit is contained in:
		@@ -12,6 +12,13 @@
 | 
				
			|||||||
# make it prominent in the GUI.
 | 
					# make it prominent in the GUI.
 | 
				
			||||||
option(BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF)
 | 
					option(BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# When other libraries are using a shared version of runtime libraries,
 | 
				
			||||||
 | 
					# Google Test also has to use one.
 | 
				
			||||||
 | 
					option(
 | 
				
			||||||
 | 
					  gtest_force_shared_crt
 | 
				
			||||||
 | 
					  "Use shared (DLL) run-time lib even when Google Test is built as static lib."
 | 
				
			||||||
 | 
					  OFF)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
option(gtest_build_tests "Build all of gtest's own tests." OFF)
 | 
					option(gtest_build_tests "Build all of gtest's own tests." OFF)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
option(gtest_build_samples "Build gtest's sample programs." OFF)
 | 
					option(gtest_build_samples "Build gtest's sample programs." OFF)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -15,7 +15,7 @@ macro(fix_default_settings)
 | 
				
			|||||||
    foreach (flag_var
 | 
					    foreach (flag_var
 | 
				
			||||||
             CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
 | 
					             CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
 | 
				
			||||||
             CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
 | 
					             CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
 | 
				
			||||||
      if (NOT BUILD_SHARED_LIBS)
 | 
					      if (NOT BUILD_SHARED_LIBS AND NOT gtest_force_shared_crt)
 | 
				
			||||||
        # When Google Test is built as a shared library, it should also use
 | 
					        # When Google Test is built as a shared library, it should also use
 | 
				
			||||||
        # shared runtime libraries.  Otherwise, it may end up with multiple
 | 
					        # shared runtime libraries.  Otherwise, it may end up with multiple
 | 
				
			||||||
        # copies of runtime library data in different modules, resulting in
 | 
					        # copies of runtime library data in different modules, resulting in
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user