diff --git a/googlemock/include/gmock/internal/gmock-internal-utils.h b/googlemock/include/gmock/internal/gmock-internal-utils.h index c9df15ea..a9a2f2d7 100644 --- a/googlemock/include/gmock/internal/gmock-internal-utils.h +++ b/googlemock/include/gmock/internal/gmock-internal-utils.h @@ -266,6 +266,8 @@ const char kInfoVerbosity[] = "info"; const char kWarningVerbosity[] = "warning"; // No logs are printed. const char kErrorVerbosity[] = "error"; +// No logs are printed. +const char kIgnoreVerbosity[] = "ignore"; // Returns true if and only if a log with the given severity is visible // according to the --gmock_verbose flag. diff --git a/googlemock/src/gmock-internal-utils.cc b/googlemock/src/gmock-internal-utils.cc index c4aca256..07961a4d 100644 --- a/googlemock/src/gmock-internal-utils.cc +++ b/googlemock/src/gmock-internal-utils.cc @@ -134,12 +134,13 @@ GTEST_API_ bool LogIsVisible(LogSeverity severity) { if (GMOCK_FLAG_GET(verbose) == kInfoVerbosity) { // Always show the log if --gmock_verbose=info. return true; - } else if (GMOCK_FLAG_GET(verbose) == kErrorVerbosity) { - // Always hide it if --gmock_verbose=error. + } else if (GMOCK_FLAG_GET(verbose) == kErrorVerbosity || + GMOCK_FLAG_GET(verbose) == kIgnoreVerbosity) { + // Always hide it if --gmock_verbose=error or --gmock_verbose=ignore. return false; } else { - // If --gmock_verbose is neither "info" nor "error", we treat it - // as "warning" (its default value). + // If --gmock_verbose is neither "info", "error", nor "ignore", + // we treat it as "warning" (its default value). return severity == kWarning; } } diff --git a/googletest/cmake/internal_utils.cmake b/googletest/cmake/internal_utils.cmake index 5bcef779..bb02ce96 100644 --- a/googletest/cmake/internal_utils.cmake +++ b/googletest/cmake/internal_utils.cmake @@ -150,14 +150,40 @@ function(cxx_library_with_type name type cxx_flags) set_target_properties(${name} PROPERTIES COMPILE_FLAGS "${cxx_flags}") + # Set the output directory for build artifacts. + set(runtime_output_dir "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") + if(NOT runtime_output_dir) + set(runtime_output_dir "${CMAKE_BINARY_DIR}/bin") + endif() + + set(library_output_dir "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}") + if(NOT library_output_dir) + set(library_output_dir "${CMAKE_BINARY_DIR}/lib") + endif() + + set(archive_output_dir "${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}") + if(NOT archive_output_dir) + set(archive_output_dir "${CMAKE_BINARY_DIR}/lib") + endif() + + set(pdb_output_dir "${CMAKE_PDB_OUTPUT_DIRECTORY}") + if(NOT pdb_output_dir) + set(pdb_output_dir "${runtime_output_dir}") + endif() + + set(compile_pdb_output_dir "${CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY}") + if(NOT compile_pdb_output_dir) + set(compile_pdb_output_dir "${archive_output_dir}") + endif() + set_target_properties(${name} PROPERTIES - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" - LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" - ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" - PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" - COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib") + RUNTIME_OUTPUT_DIRECTORY "${runtime_output_dir}" + LIBRARY_OUTPUT_DIRECTORY "${library_output_dir}" + ARCHIVE_OUTPUT_DIRECTORY "${archive_output_dir}" + PDB_OUTPUT_DIRECTORY "${pdb_output_dir}" + COMPILE_PDB_OUTPUT_DIRECTORY "${compile_pdb_output_dir}") # Make PDBs match library name. get_target_property(pdb_debug_postfix ${name} DEBUG_POSTFIX) set_target_properties(${name}