diff --git a/src/lime/main.cpp b/src/lime/main.cpp index 7c762f738..4a3b1e31b 100644 --- a/src/lime/main.cpp +++ b/src/lime/main.cpp @@ -7,6 +7,13 @@ #include "lime_sdl/lime_sdl.h" #endif +#ifdef _WIN32 +extern "C" { +// tells Nvidia drivers to use the dedicated GPU by default on laptops with switchable graphics +__declspec(dllexport) unsigned long NvOptimusEnablement = 0x00000001; +} +#endif + int main(int argc, char* argv[]) { #if ENABLE_QT bool no_gui = false; diff --git a/src/lime_qt/lime_qt.cpp b/src/lime_qt/lime_qt.cpp index b8905019e..abf40cafc 100644 --- a/src/lime_qt/lime_qt.cpp +++ b/src/lime_qt/lime_qt.cpp @@ -117,13 +117,6 @@ Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin); #endif -#ifdef _WIN32 -extern "C" { -// tells Nvidia drivers to use the dedicated GPU by default on laptops with switchable graphics -__declspec(dllexport) unsigned long NvOptimusEnablement = 0x00000001; -} -#endif - #ifdef HAVE_SDL2 #include #endif diff --git a/src/lime_sdl/lime_sdl.cpp b/src/lime_sdl/lime_sdl.cpp index 5fcf5ac66..bfcf0cf88 100644 --- a/src/lime_sdl/lime_sdl.cpp +++ b/src/lime_sdl/lime_sdl.cpp @@ -60,11 +60,6 @@ #include #include - -extern "C" { -// tells Nvidia drivers to use the dedicated GPU by default on laptops with switchable graphics -__declspec(dllexport) unsigned long NvOptimusEnablement = 0x00000001; -} #endif static void PrintHelp(const char* argv0) {