From 188d5d1df9374ebbcc1f7f2706aa05144235ff97 Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Thu, 31 Oct 2024 11:52:22 -0600 Subject: [PATCH] Add option to disable obsolete ImGui functions --- .github/workflows/ci.yml | 1 + CMakeLists.txt | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c01dd3d..b4a6a75 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -92,6 +92,7 @@ jobs: -DIMGUI_SFML_BUILD_EXAMPLES=ON \ -DIMGUI_SFML_BUILD_TESTING=ON \ -DIMGUI_SFML_ENABLE_WARNINGS=ON \ + -DIMGUI_SFML_DISABLE_OBSOLETE_FUNCTIONS=ON \ ${{matrix.platform.flags}} \ ${{matrix.config.flags}} diff --git a/CMakeLists.txt b/CMakeLists.txt index 750f537..12cc8af 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,7 @@ project(imgui_sfml VERSION 2.6 LANGUAGES CXX) option(IMGUI_SFML_FIND_SFML "Use find_package to find SFML" ON) option(IMGUI_SFML_IMGUI_DEMO "Build imgui_demo.cpp" ON) option(IMGUI_SFML_ENABLE_WARNINGS "Enable compiler warnings" OFF) +option(IMGUI_SFML_DISABLE_OBSOLETE_FUNCTIONS "Disable obsolete ImGui functions" OFF) # If you want to use your own user config when compiling ImGui, please set the following variables # For example, if you have your config in /path/to/dir/with/config/myconfig.h, set the variables as follows: @@ -84,6 +85,9 @@ if(BUILD_SHARED_LIBS) set_target_properties(ImGui-SFML PROPERTIES DEFINE_SYMBOL "IMGUI_SFML_EXPORTS") set_target_properties(ImGui-SFML PROPERTIES DEBUG_POSTFIX "_d") endif() +if(IMGUI_SFML_DISABLE_OBSOLETE_FUNCTIONS) + target_compile_definitions(ImGui-SFML PUBLIC IMGUI_DISABLE_OBSOLETE_FUNCTIONS) +endif() # Add compiler warnings if(IMGUI_SFML_ENABLE_WARNINGS)