Skip to content

Commit

Permalink
Externals: Use Common ASSERT for IM_ASSERT
Browse files Browse the repository at this point in the history
This does introduce a dependency on common and on fmt from imgui, but gives a better experience.
  • Loading branch information
Pokechu22 committed Feb 9, 2022
1 parent 2f61127 commit 3b8d112
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
9 changes: 9 additions & 0 deletions Externals/imgui/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

set(SRCS
imgui.cpp
imgui_draw.cpp
Expand All @@ -8,3 +12,8 @@ set(SRCS
add_library(imgui STATIC ${SRCS})
target_include_directories(imgui PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")

target_link_libraries(imgui
PRIVATE
common
fmt::fmt
)
5 changes: 3 additions & 2 deletions Externals/imgui/imconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@

#pragma once

#include "Common/Assert.h"

//---- 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.
//#define IM_ASSERT(_EXPR) MyAssert(_EXPR)
//#define IM_ASSERT(_EXPR) ((void)(_EXPR)) // Disable asserts
#define IM_ASSERT(_EXPR) ASSERT(_EXPR)

//---- 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.
Expand Down

0 comments on commit 3b8d112

Please sign in to comment.