diff --git a/CMakeLists.txt b/CMakeLists.txt index 5157ca2..53513df 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -80,12 +80,18 @@ endforeach() -# Optimizations -set_property(TARGET Pound PROPERTY CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE) -if (WIN32) - target_compile_options(Pound PRIVATE $<$:/Oi>) - target_compile_options(Pound PRIVATE $<$:/Ot>) -endif() +# -------------------------------- +# ---- Optimizations / Flags ----- +# -------------------------------- + +# (optional) LTO/IPO in Release, nur wenn unterstützt +set_property(TARGET Pound PROPERTY INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE) + +# MSVC-spezifische Flags NUR bei MSVC setzen (nicht bei MinGW/GCC) +target_compile_options(Pound PRIVATE + $<$,$>:/Oi /Ot> +) + target_link_libraries(Pound PRIVATE common diff --git a/src/main.cpp b/src/main.cpp index d661f72..6c1d717 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -18,7 +18,7 @@ int main() { -#if 0 +#if 1 gui::window_t window = {.data = nullptr, .gl_context = nullptr}; (void)gui::window_init(&window, "Pound Emulator", 640, 480); @@ -103,11 +103,8 @@ int main() ::glClear(GL_COLOR_BUFFER_BIT); ::ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData()); - if (bool sdl_ret_code = ::SDL_GL_SwapWindow(gui.window.data); false == sdl_ret_code) - { - LOG_ERROR("Failed to update window with OpenGL rendering: {}", SDL_GetError()); - is_running = false; - } + ::SDL_GL_SwapWindow(gui.window.data); + // Small delay to prevent excessive CPU usage std::this_thread::sleep_for(std::chrono::milliseconds(5));