Fixed compiler flags

This commit is contained in:
SChernykh 2024-02-13 15:23:32 +01:00
parent 3d9a81108d
commit b99b1689b7
8 changed files with 11 additions and 28 deletions

View file

@ -1,7 +1,3 @@
if (ARCH_ID MATCHES "^(aarch64|arm64|armv8-a)$")
set(ARMv8 1)
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES GNU)
set(GENERAL_FLAGS "-pthread")

View file

@ -24,22 +24,12 @@ set(CARES_SHARED OFF CACHE BOOL "Build as a shared library")
set(CARES_INSTALL OFF CACHE BOOL "Create installation targets (chain builders may want to disable this)")
set(CARES_BUILD_TOOLS OFF CACHE BOOL "Build tools")
if (CMAKE_CXX_COMPILER_ID MATCHES MSVC)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /W0 /Zi /Od /Ob0 /MP /MTd")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /W0 /Zi /Od /Ob0 /MP /MTd")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /W0 /O1 /Ob2 /Oi /Os /Oy /MP /MT /GL")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /W0 /O1 /Ob2 /Oi /Os /Oy /MP /MT /GL")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /W0 /Ob1 /Ot /Zi /MP /MT")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /W0 /Ob1 /Ot /Zi /MP /MT")
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Os -w")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Os -w")
endif()
if ((CMAKE_C_COMPILER_ID MATCHES MSVC) OR (CMAKE_CXX_COMPILER_ID MATCHES MSVC))
include_directories(external/src/common)
endif()
add_definitions(-DPROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII=0)
add_subdirectory(external/src/grpc)
set(LIBS ${LIBS} grpc grpc++ libprotobuf)

View file

@ -11,3 +11,7 @@ if(NOT ARCH_ID)
endif()
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" ARCH_ID)
endif()
if (ARCH_ID MATCHES "^(aarch64|arm64|armv8-a)$")
set(ARMv8 1)
endif()

View file

@ -36,8 +36,6 @@ include_directories(../grpc/third_party/protobuf/src)
include_directories(../grpc/include)
include_directories(../grpc/third_party/abseil-cpp)
set(DISABLE_WARNINGS ON)
if (CMAKE_CXX_COMPILER_ID MATCHES MSVC)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /W0 /Zi /Od /Ob0 /MP /MTd")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /W0 /Zi /Od /Ob0 /MP /MTd")

View file

@ -2,9 +2,6 @@
#ifdef _MSC_VER
#pragma warning(push, 0)
#elif __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wundef"
#endif
#include "proto/gRPC/base_node.pb.h"
@ -29,6 +26,4 @@
#ifdef _MSC_VER
#pragma warning(pop)
#elif __GNUC__
#pragma GCC diagnostic pop
#endif

2
external/src/grpc vendored

@ -1 +1 @@
Subproject commit a10d860cccab6e0ee4de8e0cf4d976b1545a66e3
Subproject commit 0de6f576b3b91c51eacc65ab0590694dbefa7663

View file

@ -1,7 +1,3 @@
if (ARCH_ID MATCHES "^(aarch64|arm64|armv8-a)$")
set(ARMv8 1)
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES GNU)
set(GENERAL_FLAGS "-pthread")
set(WARNING_FLAGS "-Wall -Wextra")

View file

@ -11,3 +11,7 @@ if(NOT ARCH_ID)
endif()
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" ARCH_ID)
endif()
if (ARCH_ID MATCHES "^(aarch64|arm64|armv8-a)$")
set(ARMv8 1)
endif()