build: Make ImHex fully compile with MSVC and Clang CL

This does NOT make ImHex work yet. However it can now be compiled
This commit is contained in:
WerWolv
2025-02-01 15:13:13 +01:00
parent 466b372d41
commit 8039ae1b90
18 changed files with 95 additions and 33 deletions

View File

@@ -13,4 +13,9 @@ add_subdirectory(imnodes)
add_subdirectory(backend)
add_subdirectory(ColorTextEditor)
set(IMGUI_LIBRARIES imgui_imgui imgui_cimgui imgui_implot imgui_implot3d imgui_imnodes imgui_backend imgui_color_text_editor PARENT_SCOPE)
set(IMGUI_LIBRARIES imgui_imgui imgui_cimgui imgui_implot imgui_implot3d imgui_imnodes imgui_backend imgui_color_text_editor)
set(IMGUI_LIBRARIES ${IMGUI_LIBRARIES} PARENT_SCOPE)
foreach (LIBRARY IN LISTS IMGUI_LIBRARIES)
target_compile_definitions(${LIBRARY} PRIVATE EXPORT_SYMBOLS=1)
endforeach ()

View File

@@ -5011,8 +5011,16 @@ typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC) (GLenum target,
#endif
#ifndef GL3W_API
#ifdef _MSC_VER
#if EXPORT_SYMBOLS == 1
#define GL3W_API __declspec(dllexport)
#else
#define GL3W_API __declspec(dllimport)
#endif
#else
#define GL3W_API
#endif
#endif
#ifndef __gl_h_
#define __gl_h_

View File

@@ -32,6 +32,22 @@ namespace hex::log::impl {
//#define IMGUI_API __declspec( dllexport )
//#define IMGUI_API __declspec( dllimport )
#if EXPORT_SYMBOLS == 1
#define IMGUI_API __declspec(dllexport)
#define IMGUI_IMPL_API __declspec(dllexport)
#define IMPLOT_API __declspec(dllexport)
#define IMPLOT_IMPL_API __declspec(dllexport)
#define IMPLOT3D_API __declspec(dllexport)
#define IMPLOT3D_IMPL_API __declspec(dllexport)
#else
#define IMGUI_API __declspec(dllimport)
#define IMGUI_IMPL_API __declspec(dllimport)
#define IMPLOT_API __declspec(dllimport)
#define IMPLOT_IMPL_API __declspec(dllimport)
#define IMPLOT3D_API __declspec(dllimport)
#define IMPLOT3D_IMPL_API __declspec(dllimport)
#endif
//---- Don't define obsolete functions/enums/behaviors. Consider enabling from time to time after updating to avoid using soon-to-be obsolete function/names.
//#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS
//#define IMGUI_DISABLE_OBSOLETE_KEYIO // 1.87: disable legacy io.KeyMap[]+io.KeysDown[] in favor io.AddKeyEvent(). This will be folded into IMGUI_DISABLE_OBSOLETE_FUNCTIONS in a few versions.

View File

@@ -17,7 +17,7 @@
struct ImNodesContext;
extern ImNodesContext* GImNodes;
IMGUI_API extern ImNodesContext* GImNodes;
// [SECTION] internal enums

View File

@@ -31,7 +31,7 @@
#define sscanf sscanf_s
#endif
ImNodesContext* GImNodes = NULL;
IMGUI_API ImNodesContext* GImNodes = NULL;
namespace IMNODES_NAMESPACE
{