CMake: added DEV_DEBUG option
This commit is contained in:
@@ -271,8 +271,8 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
config:
|
config:
|
||||||
- {os: macos-13, flags: "-Og -ftrapv"}
|
- {os: macos-13, flags: ""}
|
||||||
- {os: macos-14, flags: "-Og -ftrapv -target arm64-apple-macos-11"}
|
- {os: macos-14, flags: "-target arm64-apple-macos-11"}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
@@ -312,7 +312,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake .. -DCMAKE_C_COMPILER="$(brew --prefix llvm@15)/bin/clang" -DCMAKE_CXX_COMPILER="$(brew --prefix llvm@15)/bin/clang++" -DCMAKE_AR="$(brew --prefix llvm@15)/bin/llvm-ar" -DCMAKE_RANLIB="$(brew --prefix llvm@15)/bin/llvm-ranlib" -DCMAKE_C_FLAGS='${{ matrix.config.flags }}' -DCMAKE_CXX_FLAGS='${{ matrix.config.flags }}' -DWITH_LTO=OFF -DSTATIC_LIBS=ON -DDEV_TEST_SYNC=ON
|
cmake .. -DCMAKE_C_COMPILER="$(brew --prefix llvm@15)/bin/clang" -DCMAKE_CXX_COMPILER="$(brew --prefix llvm@15)/bin/clang++" -DCMAKE_AR="$(brew --prefix llvm@15)/bin/llvm-ar" -DCMAKE_RANLIB="$(brew --prefix llvm@15)/bin/llvm-ranlib" -DCMAKE_C_FLAGS='${{ matrix.config.flags }}' -DCMAKE_CXX_FLAGS='${{ matrix.config.flags }}' -DWITH_LTO=OFF -DSTATIC_LIBS=ON -DDEV_TEST_SYNC=ON -DDEV_DEBUG=ON
|
||||||
make -j4 p2pool
|
make -j4 p2pool
|
||||||
|
|
||||||
- name: Run p2pool
|
- name: Run p2pool
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ option(DEV_WITH_UBSAN "[Developer only] Compile with undefined behavior sanitize
|
|||||||
option(DEV_WITH_ASAN "[Developer only] Compile with address sanitizer" OFF)
|
option(DEV_WITH_ASAN "[Developer only] Compile with address sanitizer" OFF)
|
||||||
option(DEV_CLANG_TIDY "[Developer only] Compile for clang-tidy" OFF)
|
option(DEV_CLANG_TIDY "[Developer only] Compile for clang-tidy" OFF)
|
||||||
option(DEV_TRACK_MEMORY "[Developer only] Track memory allocations" OFF)
|
option(DEV_TRACK_MEMORY "[Developer only] Track memory allocations" OFF)
|
||||||
|
option(DEV_DEBUG "[Developer only] Compile a debug build" OFF)
|
||||||
|
|
||||||
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT p2pool)
|
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT p2pool)
|
||||||
|
|
||||||
@@ -83,6 +84,10 @@ if (DEV_TRACK_MEMORY)
|
|||||||
add_definitions(-DDEV_TRACK_MEMORY)
|
add_definitions(-DDEV_TRACK_MEMORY)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (DEV_DEBUG)
|
||||||
|
add_definitions(-DDEV_DEBUG)
|
||||||
|
endif()
|
||||||
|
|
||||||
include(cmake/flags.cmake)
|
include(cmake/flags.cmake)
|
||||||
|
|
||||||
set(HEADERS
|
set(HEADERS
|
||||||
|
|||||||
+4
-4
@@ -27,8 +27,8 @@ if (CMAKE_CXX_COMPILER_ID MATCHES GNU)
|
|||||||
set(WARNING_FLAGS "-w")
|
set(WARNING_FLAGS "-w")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (DEV_WITH_TSAN OR DEV_WITH_UBSAN OR DEV_WITH_ASAN)
|
if (DEV_WITH_TSAN OR DEV_WITH_UBSAN OR DEV_WITH_ASAN OR DEV_DEBUG)
|
||||||
set(OPTIMIZATION_FLAGS "-Og -g")
|
set(OPTIMIZATION_FLAGS "-Og -g -ftrapv")
|
||||||
else()
|
else()
|
||||||
set(OPTIMIZATION_FLAGS "-O3 -ffast-math -s")
|
set(OPTIMIZATION_FLAGS "-O3 -ffast-math -s")
|
||||||
endif()
|
endif()
|
||||||
@@ -99,8 +99,8 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES Clang)
|
|||||||
set(WARNING_FLAGS "-w")
|
set(WARNING_FLAGS "-w")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (DEV_WITH_MSAN)
|
if (DEV_WITH_MSAN OR DEV_DEBUG)
|
||||||
set(OPTIMIZATION_FLAGS "-Og -g")
|
set(OPTIMIZATION_FLAGS "-Og -g -ftrapv")
|
||||||
else()
|
else()
|
||||||
set(OPTIMIZATION_FLAGS "-O3 -ffast-math -funroll-loops -fmerge-all-constants")
|
set(OPTIMIZATION_FLAGS "-O3 -ffast-math -funroll-loops -fmerge-all-constants")
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
+1
-1
@@ -92,7 +92,7 @@
|
|||||||
#define __has_feature(x) 0
|
#define __has_feature(x) 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(_DEBUG) || defined(__SANITIZE_ADDRESS__) || __has_feature(address_sanitizer) || defined(__SANITIZE_THREAD__) || __has_feature(thread_sanitizer)
|
#if defined(_DEBUG) || defined(DEV_DEBUG) || defined(__SANITIZE_ADDRESS__) || __has_feature(address_sanitizer) || defined(__SANITIZE_THREAD__) || __has_feature(thread_sanitizer)
|
||||||
#define P2POOL_DEBUGGING 1
|
#define P2POOL_DEBUGGING 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -20,7 +20,7 @@
|
|||||||
#include "uv_util.h"
|
#include "uv_util.h"
|
||||||
#include "wallet.h"
|
#include "wallet.h"
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#if defined(_DEBUG) || defined(DEV_DEBUG)
|
||||||
#define POOL_BLOCK_DEBUG 1
|
#define POOL_BLOCK_DEBUG 1
|
||||||
#else
|
#else
|
||||||
#define POOL_BLOCK_DEBUG 0
|
#define POOL_BLOCK_DEBUG 0
|
||||||
|
|||||||
Reference in New Issue
Block a user