From 6b7b3511cebd9713725964335c40e98e1047d1df Mon Sep 17 00:00:00 2001 From: SChernykh Date: Tue, 27 Oct 2020 14:25:43 +0100 Subject: [PATCH] Also fix RelWithDebIfno build in Visual Studio --- cmake/flags.cmake | 4 ++-- src/crypto/randomx/jit_compiler_x86.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/flags.cmake b/cmake/flags.cmake index 788d9bdce..cb4e0610c 100644 --- a/cmake/flags.cmake +++ b/cmake/flags.cmake @@ -64,8 +64,8 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES MSVC) set(CMAKE_C_FLAGS_RELEASE "/MT /O2 /Oi /DNDEBUG /GL") set(CMAKE_CXX_FLAGS_RELEASE "/MT /O2 /Oi /DNDEBUG /GL") - set(CMAKE_C_FLAGS_RELWITHDEBINFO "/Ob1 /Zi") - set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/Ob1 /Zi") + set(CMAKE_C_FLAGS_RELWITHDEBINFO "/Ob1 /Zi /DRELWITHDEBINFO") + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/Ob1 /Zi /DRELWITHDEBINFO") add_definitions(/D_CRT_SECURE_NO_WARNINGS) add_definitions(/D_CRT_NONSTDC_NO_WARNINGS) diff --git a/src/crypto/randomx/jit_compiler_x86.cpp b/src/crypto/randomx/jit_compiler_x86.cpp index dc584d919..88c1ce4ef 100644 --- a/src/crypto/randomx/jit_compiler_x86.cpp +++ b/src/crypto/randomx/jit_compiler_x86.cpp @@ -96,7 +96,7 @@ namespace randomx { */ -# if defined(_MSC_VER) && defined(_DEBUG) +# if defined(_MSC_VER) && (defined(_DEBUG) || defined (RELWITHDEBINFO)) #define ADDR(x) ((((uint8_t*)&x)[0] == 0xE9) ? (((uint8_t*)&x) + *(const int32_t*)(((uint8_t*)&x) + 1) + 5) : ((uint8_t*)&x)) # else #define ADDR(x) ((uint8_t*)&x)