@@ -29,7 +29,7 @@ macro(fix_default_compiler_settings_)
29
29
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO )
30
30
if (NOT BUILD_SHARED_LIBS AND NOT gtest_force_shared_crt )
31
31
# 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
33
33
# copies of runtime library data in different modules, resulting in
34
34
# hard-to-find crashes. When it is built as a static library, it is
35
35
# preferable to use CRT as static libraries, as we don't have to rely
@@ -55,11 +55,11 @@ macro(fix_default_compiler_settings_)
55
55
endmacro ()
56
56
57
57
# 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
59
59
# variable's value is empty before it's explicitly assigned to.
60
60
macro (config_compiler_and_linker )
61
61
# Note: pthreads on MinGW is not supported, even if available
62
- # instead, we use windows threading primitives
62
+ # instead, we use windows threading primitives.
63
63
unset (GTEST_HAS_PTHREAD )
64
64
if (NOT gtest_disable_pthreads AND NOT MINGW )
65
65
# Defines CMAKE_USE_PTHREADS_INIT and CMAKE_THREAD_LIBS_INIT.
@@ -79,7 +79,7 @@ macro(config_compiler_and_linker)
79
79
set (cxx_exception_flags "-EHsc -D_HAS_EXCEPTIONS=1" )
80
80
set (cxx_no_exception_flags "-EHs-c- -D_HAS_EXCEPTIONS=0" )
81
81
set (cxx_no_rtti_flags "-GR-" )
82
- # Suppress "unreachable code" warning
82
+ # Suppress "unreachable code" warning,
83
83
# https://stackoverflow.com/questions/3232669 explains the issue.
84
84
set (cxx_base_flags "${cxx_base_flags} -wd4702" )
85
85
# Ensure MSVC treats source files as UTF-8 encoded.
@@ -110,7 +110,7 @@ macro(config_compiler_and_linker)
110
110
set (cxx_exception_flags "-fexceptions" )
111
111
set (cxx_no_exception_flags "-fno-exceptions" )
112
112
# 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
114
114
# explicitly.
115
115
set (cxx_no_rtti_flags "-fno-rtti -DGTEST_HAS_RTTI=0" )
116
116
set (cxx_strict_flags
@@ -127,7 +127,7 @@ macro(config_compiler_and_linker)
127
127
set (cxx_exception_flags "-qeh" )
128
128
set (cxx_no_exception_flags "-qnoeh" )
129
129
# 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
131
131
# explicitly.
132
132
set (cxx_no_rtti_flags "-qnortti -DGTEST_HAS_RTTI=0" )
133
133
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "HP" )
@@ -157,7 +157,7 @@ macro(config_compiler_and_linker)
157
157
set (cxx_strict "${cxx_default} ${cxx_strict_flags} " )
158
158
endmacro ()
159
159
160
- # Defines the gtest & gtest_main libraries. User tests should link
160
+ # Defines the gtest & gtest_main libraries. User tests should link
161
161
# with one of them.
162
162
function (cxx_library_with_type name type cxx_flags )
163
163
# type can be either STATIC or SHARED to denote a static or shared library.
@@ -167,15 +167,15 @@ function(cxx_library_with_type name type cxx_flags)
167
167
set_target_properties (${name}
168
168
PROPERTIES
169
169
COMPILE_FLAGS "${cxx_flags} " )
170
- # Set the output directory for build artifacts
170
+ # Set the output directory for build artifacts.
171
171
set_target_properties (${name}
172
172
PROPERTIES
173
173
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR} /bin"
174
174
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR} /lib"
175
175
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR} /lib"
176
176
PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR} /bin"
177
177
COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR} /lib" )
178
- # make PDBs match library name
178
+ # Make PDBs match library name.
179
179
get_target_property (pdb_debug_postfix ${name} DEBUG_POSTFIX )
180
180
set_target_properties (${name}
181
181
PROPERTIES
@@ -212,7 +212,7 @@ endfunction()
212
212
213
213
# cxx_executable_with_flags(name cxx_flags libs srcs...)
214
214
#
215
- # creates a named C++ executable that depends on the given libraries and
215
+ # Creates a named C++ executable that depends on the given libraries and
216
216
# is built from the given source files with the given compiler flags.
217
217
function (cxx_executable_with_flags name cxx_flags libs )
218
218
add_executable (${name} ${ARGN} )
@@ -239,8 +239,8 @@ endfunction()
239
239
240
240
# cxx_executable(name dir lib srcs...)
241
241
#
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
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
244
244
# the source file list.
245
245
function (cxx_executable name dir libs )
246
246
cxx_executable_with_flags (
@@ -251,7 +251,7 @@ find_package(Python3)
251
251
252
252
# cxx_test_with_flags(name cxx_flags libs srcs...)
253
253
#
254
- # creates a named C++ test that depends on the given libs and is built
254
+ # Creates a named C++ test that depends on the given libs and is built
255
255
# from the given source files with the given compiler flags.
256
256
function (cxx_test_with_flags name cxx_flags libs )
257
257
cxx_executable_with_flags (${name} "${cxx_flags} " "${libs} " ${ARGN} )
@@ -260,8 +260,8 @@ endfunction()
260
260
261
261
# cxx_test(name libs srcs...)
262
262
#
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,
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,
265
265
# test/name.cc is already implicitly included in the source file list.
266
266
function (cxx_test name libs )
267
267
cxx_test_with_flags ("${name} " "${cxx_default} " "${libs} "
@@ -270,8 +270,8 @@ endfunction()
270
270
271
271
# py_test(name)
272
272
#
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.
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.
275
275
function (py_test name )
276
276
if (NOT Python3_Interpreter_FOUND )
277
277
return ()
@@ -307,7 +307,7 @@ function(install_project)
307
307
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR} "
308
308
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR} " )
309
309
if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
310
- # Install PDBs
310
+ # Install PDBs.
311
311
foreach (t ${ARGN} )
312
312
get_target_property (t_pdb_name ${t} COMPILE_PDB_NAME )
313
313
get_target_property (t_pdb_name_debug ${t} COMPILE_PDB_NAME_DEBUG )
0 commit comments