diff --git a/cmake/add_warning.cmake b/cmake/add_warning.cmake index bc9642c9cc6..e7797fcc7a6 100644 --- a/cmake/add_warning.cmake +++ b/cmake/add_warning.cmake @@ -12,13 +12,13 @@ macro (add_warning flag) if (SUPPORTS_CXXFLAG_${underscored_flag}) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W${flag}") else () - message (WARNING "Flag -W${flag} is unsupported") + message (STATUS "Flag -W${flag} is unsupported") endif () if (SUPPORTS_CFLAG_${underscored_flag}) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -W${flag}") else () - message (WARNING "Flag -W${flag} is unsupported") + message (STATUS "Flag -W${flag} is unsupported") endif () endmacro () @@ -39,7 +39,7 @@ macro (target_add_warning target flag) if (SUPPORTS_CXXFLAG_${underscored_flag}) target_compile_options (${target} PRIVATE "-W${flag}") else () - message (WARNING "Flag -W${flag} is unsupported") + message (STATUS "Flag -W${flag} is unsupported") endif () endmacro () diff --git a/contrib/protobuf-cmake/CMakeLists.txt b/contrib/protobuf-cmake/CMakeLists.txt index 82e212417ac..484524f4278 100644 --- a/contrib/protobuf-cmake/CMakeLists.txt +++ b/contrib/protobuf-cmake/CMakeLists.txt @@ -211,7 +211,9 @@ add_library(protobuf::libprotoc ALIAS libprotoc) set(protoc_files ${protobuf_source_dir}/src/google/protobuf/compiler/main.cc) -if (NOT CMAKE_CROSSCOMPILING) +if (CMAKE_HOST_SYSTEM_NAME STREQUAL CMAKE_SYSTEM_NAME + AND CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL CMAKE_SYSTEM_PROCESSOR) + add_executable(protoc ${protoc_files}) target_link_libraries(protoc libprotoc libprotobuf pthread) add_executable(protobuf::protoc ALIAS protoc)