From 7b5ba862f72349ca5cffb287e9bfb3e4da308e51 Mon Sep 17 00:00:00 2001 From: emb <> Date: Mon, 23 Feb 2015 22:15:26 -0600 Subject: [PATCH] XP support (using mingw compiler) --- Build Instructions.txt | 40 ++++++++----------- RetroFE/Source/CMakeLists.txt | 13 ++++-- .../SDL2-2.0.3/include/SDL2/SDL_platform.h | 4 +- 3 files changed, 29 insertions(+), 28 deletions(-) diff --git a/Build Instructions.txt b/Build Instructions.txt index 1787adc..c2e0020 100644 --- a/Build Instructions.txt +++ b/Build Instructions.txt @@ -1,3 +1,20 @@ +Linux Setup +=============================== +Install ubuntu or xubuntu 14.04 +Run the following command to install necessary dependencies + sudo apt-get install git g++ cmake dos2unix zlib1g-dev libsdl2-2.0 libsdl2-mixer-2.0 libsdl2-image-2.0 libsdl2-ttf-2.0 \ + libsdl2-dev libsdl2-mixer-dev libsdl2-image-dev libsdl2-ttf-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \ + libgstreamer-plugins-good1.0-dev zlib1g-dev libglib2.0-0 libglib2.0-dev sqlite3 + +To build, run the following command: + +./Build.sh + +Files will output to Artifacts/RetroFE. Copy this directory to any folder of your choosing (i.e.) + +cp -r Artifacts/RetroFE /opt + + Windows Setup =============================== Install Python 2.7 @@ -29,26 +46,3 @@ Build Configuration/Configuration.sln copy Configuration.exe to Artifacts/RetroFE Build documentation and copy to Artifacts/RetroFE/Documentation - - -Linux Setup -=============================== -Install ubuntu or xubuntu 14.04 -Run the following command -sudo apt-get install git g++ cmake zlib1g-dev libsdl2-2.0 libsdl2-mixer-2.0 libsdl2-image-2.0 libsdl2-ttf-2.0 \ - libsdl2-dev libsdl2-mixer-dev libsdl2-image-dev libsdl2-ttf-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \ - libgstreamer-plugins-good1.0-dev zlib1g-dev libglib2.0-0 libglib2.0-dev sqlite3 - -To build: - cd RetroFE - cmake Source -BBuild -DVERSION_MAJOR=0 -DVERSION_MINOR=0 -DVERSION_BUILD=0 - cd Build - make - -To package: -Create a Artifacts/RetroFE folder -Copy Package/Environment/Common/* to Artifacts/RetroFE -Copy Package/Environment/Linux/* to Artifacts/RetroFE -Copy Build/RetroFE binary to Artifacts/RetroFE - -Build documentation and copy to Artifacts/RetroFE/Documentation diff --git a/RetroFE/Source/CMakeLists.txt b/RetroFE/Source/CMakeLists.txt index fa7c87b..e22eb55 100644 --- a/RetroFE/Source/CMakeLists.txt +++ b/RetroFE/Source/CMakeLists.txt @@ -26,7 +26,7 @@ if(WIN32) set(DIRENT_INCLUDE_DIR "${RETROFE_THIRD_PARTY_DIR}/dirent-1.20.1/include") endif() -if(MSVC) +if(WIN32) find_package(Glib2 REQUIRED) find_package(GStreamer REQUIRED) find_package(SDL2 REQUIRED) @@ -56,9 +56,12 @@ set(RETROFE_INCLUDE_DIRS "${ZLIB_INCLUDE_DIRS}" "${SQLITE3_ROOT}" "${RAPIDXML_ROOT}" - "${DIRENT_INCLUDE_DIR}" ) +if(MSVC) +LIST(APPEND RETROFE_INCLUDE_DIRS "${DIRENT_INCLUDE_DIR}") +endif() + set(RETROFE_LIBRARIES ${GLIB2_LIBRARIES} ${GSTREAMER_LIBRARIES} @@ -69,7 +72,7 @@ set(RETROFE_LIBRARIES ${ZLIB_LIBRARIES} ) -if(NOT MSVC) +if(NOT WIN32) LIST(APPEND RETROFE_LIBRARIES ${CMAKE_DL_LIBS} ${CMAKE_THREAD_LIBS_INIT}) endif() @@ -176,6 +179,10 @@ add_definitions(-DRETROFE_VERSION_MAJOR=${VERSION_MAJOR}) add_definitions(-DRETROFE_VERSION_MINOR=${VERSION_MINOR}) add_definitions(-DRETROFE_VERSION_BUILD=${VERSION_BUILD}) +if(MINGW) + set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++") +endif() + if(MSVC) set(CMAKE_DEBUG_POSTFIX "d") add_definitions(-D_CRT_SECURE_NO_DEPRECATE) diff --git a/RetroFE/ThirdParty/SDL2-2.0.3/include/SDL2/SDL_platform.h b/RetroFE/ThirdParty/SDL2-2.0.3/include/SDL2/SDL_platform.h index c43f4b5..83381be 100644 --- a/RetroFE/ThirdParty/SDL2-2.0.3/include/SDL2/SDL_platform.h +++ b/RetroFE/ThirdParty/SDL2-2.0.3/include/SDL2/SDL_platform.h @@ -114,10 +114,10 @@ #define __SOLARIS__ 1 #endif -#if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) +#if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__) /* Try to find out if we're compiling for WinRT or non-WinRT */ /* If _USING_V110_SDK71_ is defined it means we are using the v110_xp or v120_xp toolset. */ -#if defined(__MINGW32__) || (defined(_MSC_VER) && (_MSC_VER >= 1700) && !_USING_V110_SDK71_) /* _MSC_VER==1700 for MSVC 2012 */ +#if (defined(_MSC_VER) && (_MSC_VER >= 1700) && !_USING_V110_SDK71_) /* _MSC_VER==1700 for MSVC 2012 */ #include #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) #undef __WINDOWS__