aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-p2p/p2pool/files/flags.cmake')
-rw-r--r--net-p2p/p2pool/files/flags.cmake45
1 files changed, 34 insertions, 11 deletions
diff --git a/net-p2p/p2pool/files/flags.cmake b/net-p2p/p2pool/files/flags.cmake
index ed7e75499..367863e89 100644
--- a/net-p2p/p2pool/files/flags.cmake
+++ b/net-p2p/p2pool/files/flags.cmake
@@ -1,14 +1,37 @@
-set(CMAKE_CXX_STANDARD_REQUIRED ON)
-set(CMAKE_CXX_EXTENSIONS OFF)
-set(CMAKE_CXX_STANDARD 14)
-
-set(CMAKE_C_STANDARD 99)
-set(CMAKE_C_STANDARD_REQUIRED ON)
-
set(GENERAL_FLAGS "-pthread")
+if (CMAKE_CXX_COMPILER_ID MATCHES GNU)
+
+ if (ARMv8)
+ set(GENERAL_FLAGS "${GENERAL_FLAGS} -mfix-cortex-a53-835769 -mfix-cortex-a53-843419")
+ endif()
+
+ set(WARNING_FLAGS "-Wall -Wextra -Wcast-qual -Wlogical-op -Wundef -Wformat=2 -Wpointer-arith -Werror")
+ if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.5.0)
+ set(WARNING_FLAGS "${WARNING_FLAGS} -Wstrict-overflow=2")
+ endif()
+
+ if (STATIC_BINARY)
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
+ else()
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++")
+ endif()
+
+elseif (CMAKE_CXX_COMPILER_ID MATCHES Clang)
+
+ if (ARMv8)
+ set(GENERAL_FLAGS "${GENERAL_FLAGS} -mfix-cortex-a53-835769")
+ endif()
+
+ set(WARNING_FLAGS "-Wall -Wextra -Wno-undefined-internal -Wunreachable-code-aggressive -Wmissing-prototypes -Wmissing-variable-declarations -Werror")
+
+endif()
+
+if (DISABLE_WARNINGS)
+ set(WARNING_FLAGS "-w")
+endif()
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GENERAL_FLAGS}")
-set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${GENERAL_FLAGS}")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GENERAL_FLAGS} ${WARNING_FLAGS}")
+set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${GENERAL_FLAGS} ${WARNING_FLAGS}")
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GENERAL_FLAGS}")
-set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${GENERAL_FLAGS}")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GENERAL_FLAGS} ${WARNING_FLAGS}")
+set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${GENERAL_FLAGS} ${WARNING_FLAGS}")