-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
imgui: move Objective-C++ backends to a separate test
- Loading branch information
Showing
4 changed files
with
48 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,17 @@ | ||
cmake_minimum_required(VERSION 3.8) | ||
cmake_minimum_required(VERSION 3.15) | ||
project(test_package LANGUAGES CXX) | ||
|
||
find_package(imgui REQUIRED CONFIG) | ||
|
||
add_compile_definitions("IMGUI_USER_CONFIG=\"${CMAKE_CURRENT_SOURCE_DIR}/my_imgui_config.h\"") | ||
add_executable(${PROJECT_NAME} test_package.cpp) | ||
# Using the aggregate target for easier testing. | ||
target_link_libraries(${PROJECT_NAME} PRIVATE imgui::imgui_all) | ||
target_compile_definitions(${PROJECT_NAME} PUBLIC "IMGUI_USER_CONFIG=\"${CMAKE_CURRENT_SOURCE_DIR}/my_imgui_config.h\"") | ||
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) | ||
|
||
if(APPLE) | ||
enable_language(OBJCXX) | ||
add_executable(${PROJECT_NAME}_objcxx test_package.mm) | ||
target_link_libraries(${PROJECT_NAME}_objcxx PRIVATE imgui::imgui_all) | ||
target_compile_features(${PROJECT_NAME}_objcxx PRIVATE cxx_std_11) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#include <imgui.h> | ||
|
||
#ifdef DOCKING | ||
#include <imgui_internal.h> | ||
#endif | ||
|
||
#ifdef IMGUI_IMPL_OSX | ||
#include <imgui_impl_osx.h> | ||
#endif | ||
#ifdef IMGUI_IMPL_METAL | ||
#include <imgui_impl_metal.h> | ||
#endif | ||
|
||
#include <cstdio> | ||
|
||
void test_backends() { | ||
#ifdef IMGUI_IMPL_OSX | ||
ImGui_ImplOSX_Shutdown(); | ||
#endif | ||
#ifdef IMGUI_IMPL_METAL | ||
ImGui_ImplMetal_Shutdown(); | ||
#endif | ||
} | ||
|
||
int main() { | ||
printf("IMGUI VERSION: %s\n", IMGUI_VERSION); | ||
ImGui::CreateContext(); | ||
#ifdef DOCKING | ||
printf(" with docking\n"); | ||
#endif | ||
ImGui::DestroyContext(); | ||
return 0; | ||
} |