Externals: Use Common ASSERT for IM_ASSERT

This does introduce a dependency on common and on fmt from imgui, but gives a better experience.
This commit is contained in:
Pokechu22 2022-01-16 19:49:15 -08:00
parent 9e19d10f9d
commit 72c7977c72
3 changed files with 13 additions and 2 deletions

View File

@ -1,3 +1,7 @@
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(SRCS set(SRCS
imgui.cpp imgui.cpp
imgui_draw.cpp imgui_draw.cpp
@ -8,3 +12,8 @@ set(SRCS
add_library(imgui STATIC ${SRCS}) add_library(imgui STATIC ${SRCS})
target_include_directories(imgui PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(imgui PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
target_link_libraries(imgui
PRIVATE
common
fmt::fmt
)

1
Externals/imgui/README.txt vendored Normal file
View File

@ -0,0 +1 @@
When updating, make sure to preserve changes to imconfig.h. Dolphin modifies it to use a custom assertion handler and to tweak settings.

View File

@ -14,10 +14,11 @@
#pragma once #pragma once
#include "Common/Assert.h"
//---- Define assertion handler. Defaults to calling assert(). //---- Define assertion handler. Defaults to calling assert().
// If your macro uses multiple statements, make sure is enclosed in a 'do { .. } while (0)' block so it can be used as a single statement. // If your macro uses multiple statements, make sure is enclosed in a 'do { .. } while (0)' block so it can be used as a single statement.
//#define IM_ASSERT(_EXPR) MyAssert(_EXPR) #define IM_ASSERT(_EXPR) ASSERT(_EXPR)
//#define IM_ASSERT(_EXPR) ((void)(_EXPR)) // Disable asserts
//---- Define attributes of all API symbols declarations, e.g. for DLL under Windows //---- Define attributes of all API symbols declarations, e.g. for DLL under Windows
// Using Dear ImGui via a shared library is not recommended, because of function call overhead and because we don't guarantee backward nor forward ABI compatibility. // Using Dear ImGui via a shared library is not recommended, because of function call overhead and because we don't guarantee backward nor forward ABI compatibility.