Skip to content

Commit

Permalink
Fixed compiler flags
Browse files Browse the repository at this point in the history
  • Loading branch information
SChernykh committed Feb 13, 2024
1 parent 3d9a811 commit 3bf5391
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 23 deletions.
4 changes: 0 additions & 4 deletions cmake/flags.cmake
Original file line number Diff line number Diff line change
@@ -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")

Expand Down
12 changes: 0 additions & 12 deletions cmake/grpc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,6 @@ 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()
Expand Down
4 changes: 4 additions & 0 deletions cmake/standard.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
4 changes: 2 additions & 2 deletions external/src/Tari/proto.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#ifdef _MSC_VER
#pragma warning(push, 0)
#elif __GNUC__
#elif defined __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wundef"
#endif
Expand All @@ -29,6 +29,6 @@

#ifdef _MSC_VER
#pragma warning(pop)
#elif __GNUC__
#elif defined __GNUC__
#pragma GCC diagnostic pop
#endif
2 changes: 1 addition & 1 deletion external/src/grpc
Submodule grpc updated 1 files
+12 −0 CMakeLists.txt
4 changes: 0 additions & 4 deletions tests/cmake/flags.cmake
Original file line number Diff line number Diff line change
@@ -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")
Expand Down
4 changes: 4 additions & 0 deletions tests/cmake/standard.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit 3bf5391

Please sign in to comment.