@@ -29,7 +29,7 @@ macro(fix_default_compiler_settings_)
2929 CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO )
3030 if (NOT BUILD_SHARED_LIBS AND NOT gtest_force_shared_crt)
3131 # When Google Test is built as a shared library, it should also use
32- # shared runtime libraries. Otherwise, it may end up with multiple
32+ # shared runtime libraries. Otherwise, it may end up with multiple
3333 # copies of runtime library data in different modules, resulting in
3434 # hard-to-find crashes. When it is built as a static library, it is
3535 # preferable to use CRT as static libraries, as we don't have to rely
@@ -55,11 +55,11 @@ macro(fix_default_compiler_settings_)
5555endmacro ()
5656
5757# Defines the compiler/linker flags used to build Google Test and
58- # Google Mock. You can tweak these definitions to suit your need. A
58+ # Google Mock. You can tweak these definitions to suit your need. A
5959# variable's value is empty before it's explicitly assigned to.
6060macro (config_compiler_and_linker)
6161 # Note: pthreads on MinGW is not supported, even if available
62- # instead, we use windows threading primitives
62+ # instead, we use windows threading primitives.
6363 unset (GTEST_HAS_PTHREAD)
6464 if (NOT gtest_disable_pthreads AND NOT MINGW)
6565 # Defines CMAKE_USE_PTHREADS_INIT and CMAKE_THREAD_LIBS_INIT.
@@ -79,7 +79,7 @@ macro(config_compiler_and_linker)
7979 set (cxx_exception_flags "-EHsc -D_HAS_EXCEPTIONS=1" )
8080 set (cxx_no_exception_flags "-EHs-c- -D_HAS_EXCEPTIONS=0" )
8181 set (cxx_no_rtti_flags "-GR-" )
82- # Suppress "unreachable code" warning
82+ # Suppress "unreachable code" warning,
8383 # https://stackoverflow.com/questions/3232669 explains the issue.
8484 set (cxx_base_flags "${cxx_base_flags} -wd4702" )
8585 # Ensure MSVC treats source files as UTF-8 encoded.
@@ -110,7 +110,7 @@ macro(config_compiler_and_linker)
110110 set (cxx_exception_flags "-fexceptions" )
111111 set (cxx_no_exception_flags "-fno-exceptions" )
112112 # Until version 4.3.2, GCC doesn't define a macro to indicate
113- # whether RTTI is enabled. Therefore we define GTEST_HAS_RTTI
113+ # whether RTTI is enabled. Therefore we define GTEST_HAS_RTTI
114114 # explicitly.
115115 set (cxx_no_rtti_flags "-fno-rtti -DGTEST_HAS_RTTI=0" )
116116 set (cxx_strict_flags
@@ -127,7 +127,7 @@ macro(config_compiler_and_linker)
127127 set (cxx_exception_flags "-qeh" )
128128 set (cxx_no_exception_flags "-qnoeh" )
129129 # Until version 9.0, Visual Age doesn't define a macro to indicate
130- # whether RTTI is enabled. Therefore we define GTEST_HAS_RTTI
130+ # whether RTTI is enabled. Therefore we define GTEST_HAS_RTTI
131131 # explicitly.
132132 set (cxx_no_rtti_flags "-qnortti -DGTEST_HAS_RTTI=0" )
133133 elseif (CMAKE_CXX_COMPILER_ID STREQUAL "HP" )
@@ -157,7 +157,7 @@ macro(config_compiler_and_linker)
157157 set (cxx_strict "${cxx_default} ${cxx_strict_flags} " )
158158endmacro ()
159159
160- # Defines the gtest & gtest_main libraries. User tests should link
160+ # Defines the gtest & gtest_main libraries. User tests should link
161161# with one of them.
162162function (cxx_library_with_type name type cxx_flags )
163163 # type can be either STATIC or SHARED to denote a static or shared library.
@@ -167,15 +167,14 @@ function(cxx_library_with_type name type cxx_flags)
167167 set_target_properties (${name}
168168 PROPERTIES
169169 COMPILE_FLAGS "${cxx_flags} " )
170- # Set the output directory for build artifacts
170+ # Set the output directory for build artifacts.
171171 set_target_properties (${name}
172172 PROPERTIES
173173 RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR} /bin"
174174 LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR} /lib"
175175 ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR} /lib"
176176 PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR} /bin"
177- COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR} /lib" )
178- # make PDBs match library name
177+ # Make PDBs match library name.
179178 get_target_property (pdb_debug_postfix ${name} DEBUG_POSTFIX )
180179 set_target_properties (${name}
181180 PROPERTIES
@@ -212,7 +211,7 @@ endfunction()
212211
213212# cxx_executable_with_flags(name cxx_flags libs srcs...)
214213#
215- # creates a named C++ executable that depends on the given libraries and
214+ # Creates a named C++ executable that depends on the given libraries and
216215# is built from the given source files with the given compiler flags.
217216function (cxx_executable_with_flags name cxx_flags libs)
218217 add_executable (${name} ${ARGN} )
@@ -239,8 +238,8 @@ endfunction()
239238
240239# cxx_executable(name dir lib srcs...)
241240#
242- # creates a named target that depends on the given libs and is built
243- # from the given source files. dir/name.cc is implicitly included in
241+ # Creates a named target that depends on the given libs and is built
242+ # from the given source files. dir/name.cc is implicitly included in
244243# the source file list.
245244function (cxx_executable name dir libs)
246245 cxx_executable_with_flags(
@@ -251,7 +250,7 @@ find_package(Python3)
251250
252251# cxx_test_with_flags(name cxx_flags libs srcs...)
253252#
254- # creates a named C++ test that depends on the given libs and is built
253+ # Creates a named C++ test that depends on the given libs and is built
255254# from the given source files with the given compiler flags.
256255function (cxx_test_with_flags name cxx_flags libs)
257256 cxx_executable_with_flags(${name} "${cxx_flags} " "${libs} " ${ARGN} )
@@ -260,8 +259,8 @@ endfunction()
260259
261260# cxx_test(name libs srcs...)
262261#
263- # creates a named test target that depends on the given libs and is
264- # built from the given source files. Unlike cxx_test_with_flags,
262+ # Creates a named test target that depends on the given libs and is
263+ # built from the given source files. Unlike cxx_test_with_flags,
265264# test/name.cc is already implicitly included in the source file list.
266265function (cxx_test name libs)
267266 cxx_test_with_flags("${name} " "${cxx_default} " "${libs} "
@@ -270,8 +269,8 @@ endfunction()
270269
271270# py_test(name)
272271#
273- # creates a Python test with the given name whose main module is in
274- # test/name.py. It does nothing if Python is not installed.
272+ # Creates a Python test with the given name whose main module is in
273+ # test/name.py. It does nothing if Python is not installed.
275274function (py_test name )
276275 if (NOT Python3_Interpreter_FOUND)
277276 return ()
@@ -307,7 +306,7 @@ function(install_project)
307306 ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR} "
308307 LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR} " )
309308 if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
310- # Install PDBs
309+ # Install PDBs.
311310 foreach (t ${ARGN} )
312311 get_target_property (t_pdb_name ${t} COMPILE_PDB_NAME)
313312 get_target_property (t_pdb_name_debug ${t} COMPILE_PDB_NAME_DEBUG)
0 commit comments