From c9461f7dbe41ea6989bf65cb86e108a5f6e37878 Mon Sep 17 00:00:00 2001 From: rmaia3d <9812730+rmaia3d@users.noreply.github.com> Date: Fri, 31 Dec 2021 12:04:10 -0300 Subject: [PATCH] changes so it compiles on Ubuntu 20.04 --- CMakeLists.txt | 9 ++++++++- common/App.cpp | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b8bf558..9c01e39 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,9 @@ cmake_minimum_required(VERSION 3.0.0) project(implot_demos VERSION 0.1.0) +set(CMAKE_CXX_STANDARD 17) +add_compile_options(-O3 -march=native) + ############################################################################### # 3RD PARTY LIBS ############################################################################### @@ -82,7 +85,11 @@ add_library(imgui ${IMGUI_HEADERS} ${IMGUI_SRC}) if(MSVC) target_compile_options(imgui PRIVATE /W4 /WX /arch:AVX2 /fp:fast) endif() -target_link_libraries(imgui PUBLIC glfw glad OpenGL::GL imm32) +if(WIN32) + target_link_libraries(imgui PUBLIC glfw glad OpenGL::GL imm32) +else() + target_link_libraries(imgui PUBLIC glfw glad OpenGL::GL) +endif() target_compile_definitions(imgui PRIVATE IMGUI_DLL_EXPORT) include_directories(../imgui/ ../imgui/examples ../imgui/examples/libs/gl3w ../imgui/backends ../imgui/misc/cpp) diff --git a/common/App.cpp b/common/App.cpp index 15670b9..108f304 100644 --- a/common/App.cpp +++ b/common/App.cpp @@ -149,7 +149,9 @@ App::App(std::string title, int w, int h, int argc, char const *argv[]) const bool no_vsync = result["vsync"].as(); const bool use_msaa = result["msaa"].as(); const bool im_style = result["imgui"].as(); +#if defined(_WIN32) NvOptimusEnablement = AmdPowerXpressRequestHighPerformance = result["gpu"].as(); +#endif #ifdef _DEBUG title += " - OpenGL - Debug";