mirror of
https://github.com/glest/glest-source.git
synced 2025-09-26 07:28:59 +02:00
- few tweaks to get things compiling under mingw
This commit is contained in:
@@ -6,6 +6,7 @@
|
|||||||
# FTGL_FOUND - system has ftgl
|
# FTGL_FOUND - system has ftgl
|
||||||
# FTGL_INCLUDE_DIR - path to FTGL/FTGL.h
|
# FTGL_INCLUDE_DIR - path to FTGL/FTGL.h
|
||||||
# FTGL_LIBRARY - the library that must be included
|
# FTGL_LIBRARY - the library that must be included
|
||||||
|
# FTGL_LIBRARY_PATH - the library path
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
||||||
@@ -14,17 +15,34 @@ IF(WANT_STATIC_LIBS)
|
|||||||
OPTION(FTGL_STATIC "Set to ON to link your project with static library (instead of DLL)." ON)
|
OPTION(FTGL_STATIC "Set to ON to link your project with static library (instead of DLL)." ON)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
#message(STATUS "!!!!!!!!!!!!!!!!!!!!!!!!!!!!! #1 Searching for FTGL lib in custom path: [${FTGL_LIBRARY_PATH}]")
|
||||||
|
|
||||||
IF (FTGL_LIBRARY AND FTGL_INCLUDE_DIR)
|
IF (FTGL_LIBRARY AND FTGL_INCLUDE_DIR)
|
||||||
SET(FTGL_FOUND "YES")
|
SET(FTGL_FOUND "YES")
|
||||||
|
message(STATUS "!!!!!!!!!!!!!!!!!!!!!!!!!!!!! FTGL lib ALREADY FOUND in: [${FTGL_LIBRARY}]")
|
||||||
ELSE (FTGL_LIBRARY AND FTGL_INCLUDE_DIR)
|
ELSE (FTGL_LIBRARY AND FTGL_INCLUDE_DIR)
|
||||||
|
|
||||||
FIND_PATH(FTGL_INCLUDE_DIR FTGL/ftgl.h PATHS /usr/local/include /usr/include)
|
IF(FTGL_LIBRARY_PATH)
|
||||||
|
message(STATUS "!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Searching for FTGL lib in custom path: [${FTGL_LIBRARY_PATH}]")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
IF (FTGL_STATIC AND NOT FTGL_LIBRARY)
|
FIND_PATH(FTGL_INCLUDE_DIR FTGL/ftgl.h
|
||||||
FIND_LIBRARY(FTGL_LIBRARY NAMES libftgl.a ftgl PATHS /usr/local/lib /usr/lib)
|
PATHS /usr/local/include
|
||||||
ELSE()
|
/usr/include)
|
||||||
FIND_LIBRARY(FTGL_LIBRARY NAMES ftgl PATHS /usr/local/lib /usr/lib)
|
|
||||||
ENDIF()
|
IF (FTGL_STATIC AND NOT FTGL_LIBRARY)
|
||||||
|
FIND_LIBRARY(FTGL_LIBRARY
|
||||||
|
NAMES libftgl.a ftgl libftgl libftgl.dll
|
||||||
|
PATHS /usr/local/lib
|
||||||
|
/usr/lib
|
||||||
|
${FTGL_LIBRARY_PATH})
|
||||||
|
ELSE()
|
||||||
|
FIND_LIBRARY(FTGL_LIBRARY
|
||||||
|
NAMES ftgl libftgl libftgl.dll libftgl.a
|
||||||
|
PATHS /usr/local/lib
|
||||||
|
/usr/lib
|
||||||
|
${FTGL_LIBRARY_PATH})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
IF (FTGL_INCLUDE_DIR AND FTGL_LIBRARY)
|
IF (FTGL_INCLUDE_DIR AND FTGL_LIBRARY)
|
||||||
SET(FTGL_FOUND "YES")
|
SET(FTGL_FOUND "YES")
|
||||||
|
@@ -18,6 +18,8 @@ macro(special_check_for_sse _max_sse_level_desired)
|
|||||||
|
|
||||||
# check for SSE extensions
|
# check for SSE extensions
|
||||||
include(CheckCXXSourceRuns)
|
include(CheckCXXSourceRuns)
|
||||||
|
include(CheckCSourceRuns)
|
||||||
|
|
||||||
if( CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX )
|
if( CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX )
|
||||||
set(SSE_FLAGS)
|
set(SSE_FLAGS)
|
||||||
|
|
||||||
@@ -107,6 +109,8 @@ endmacro(special_check_for_sse)
|
|||||||
macro(special_check_for_x87)
|
macro(special_check_for_x87)
|
||||||
# check for X87 support
|
# check for X87 support
|
||||||
include(CheckCXXSourceRuns)
|
include(CheckCXXSourceRuns)
|
||||||
|
include(CheckCSourceRuns)
|
||||||
|
|
||||||
if( CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX )
|
if( CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX )
|
||||||
|
|
||||||
check_cxx_source_runs("
|
check_cxx_source_runs("
|
||||||
|
@@ -2,12 +2,23 @@
|
|||||||
SET(CMAKE_SYSTEM_NAME Windows)
|
SET(CMAKE_SYSTEM_NAME Windows)
|
||||||
|
|
||||||
# which compilers to use for C and C++
|
# which compilers to use for C and C++
|
||||||
SET(CMAKE_C_COMPILER i586-mingw32msvc-gcc)
|
#SET(CMAKE_C_COMPILER i586-mingw32msvc-gcc)
|
||||||
SET(CMAKE_CXX_COMPILER i586-mingw32msvc-g++)
|
#SET(CMAKE_CXX_COMPILER i586-mingw32msvc-g++)
|
||||||
SET(CMAKE_RC_COMPILER i586-mingw32msvc-windres)
|
#SET(CMAKE_RC_COMPILER i586-mingw32msvc-windres)
|
||||||
|
SET(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)
|
||||||
|
SET(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
|
||||||
|
SET(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres)
|
||||||
|
|
||||||
# here is the target environment located
|
# here is the target environment located
|
||||||
SET(CMAKE_FIND_ROOT_PATH /usr/i586-mingw32msvc ${PROJECT_SOURCE_DIR}/source/win32_deps/lib)
|
#SET(CMAKE_FIND_ROOT_PATH /usr/i586-mingw32msvc ${PROJECT_SOURCE_DIR}/source/win32_deps/lib)
|
||||||
|
SET(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32 ${PROJECT_SOURCE_DIR}/source/win32_deps/lib)
|
||||||
|
include_directories(${PROJECT_SOURCE_DIR}/source/win32_deps/freetype-2.4.8/include)
|
||||||
|
include_directories(${PROJECT_SOURCE_DIR}/source/win32_deps/glew-1.7.0/include)
|
||||||
|
include_directories(${PROJECT_SOURCE_DIR}/source/win32_deps/ftgl-2.1.3~rc5/src)
|
||||||
|
#add_definitions(-std=c++0x)
|
||||||
|
add_definitions( -std=gnu++0x )
|
||||||
|
add_definitions( -DTA3D_PLATFORM_MSVC=1 )
|
||||||
|
add_definitions( -DTA3D_PLATFORM_WINDOWS=1 )
|
||||||
|
|
||||||
# adjust the default behaviour of the FIND_XXX() commands:
|
# adjust the default behaviour of the FIND_XXX() commands:
|
||||||
# search headers and libraries in the target environment, search
|
# search headers and libraries in the target environment, search
|
||||||
|
@@ -16,6 +16,7 @@
|
|||||||
#include "xml_parser.h"
|
#include "xml_parser.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "conversion.h"
|
#include "conversion.h"
|
||||||
|
#include <memory>
|
||||||
#include"platform_util.h"
|
#include"platform_util.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
@@ -24,6 +24,7 @@
|
|||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include <wx/stdpaths.h>
|
#include <wx/stdpaths.h>
|
||||||
#include <platform_util.h>
|
#include <platform_util.h>
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace Shared::PlatformCommon;
|
using namespace Shared::PlatformCommon;
|
||||||
|
@@ -483,6 +483,7 @@ Intro::Intro(Program *program):
|
|||||||
//test = NULL;
|
//test = NULL;
|
||||||
//Shared::Graphics::md5::initMD5OpenGL(data_path + "data/core/shaders/");
|
//Shared::Graphics::md5::initMD5OpenGL(data_path + "data/core/shaders/");
|
||||||
//md5Test = Shared::Graphics::md5::getMD5ObjectFromLoaderScript("/home/softcoder/Code/megaglest/trunk/mk/linux/mydata/test/mv1/mv1.loader");
|
//md5Test = Shared::Graphics::md5::getMD5ObjectFromLoaderScript("/home/softcoder/Code/megaglest/trunk/mk/linux/mydata/test/mv1/mv1.loader");
|
||||||
|
//md5Test = Shared::Graphics::md5::getMD5ObjectFromLoaderScript("/home/softcoder/Code/megaglest/trunk/mk/linux/mydata/test/mv1/mv2.loader");
|
||||||
|
|
||||||
SoundRenderer &soundRenderer= SoundRenderer::getInstance();
|
SoundRenderer &soundRenderer= SoundRenderer::getInstance();
|
||||||
|
|
||||||
@@ -638,7 +639,8 @@ void Intro::render() {
|
|||||||
|
|
||||||
//printf("animTimer.deltaTime () = %f anim = %f animTimer.deltaTime() / 25.0 = %f\n",animTimer.deltaTime (),anim,animTimer.deltaTime() / 25.0);
|
//printf("animTimer.deltaTime () = %f anim = %f animTimer.deltaTime() / 25.0 = %f\n",animTimer.deltaTime (),anim,animTimer.deltaTime() / 25.0);
|
||||||
//double anim = animTimer.deltaTime();
|
//double anim = animTimer.deltaTime();
|
||||||
//Shared::Graphics::md5::renderMD5Object(md5Test, animTimer.deltaTime() / 30.0, &modelViewMatrix);
|
// Shared::Graphics::md5::renderMD5Object(md5Test, animTimer.deltaTime() / 30.0, &modelViewMatrix);
|
||||||
|
//Shared::Graphics::md5::renderMD5Object(md5Test, animTimer.deltaTime() / 30.0, NULL);
|
||||||
|
|
||||||
// if(test == NULL) {
|
// if(test == NULL) {
|
||||||
// glClearColor (0.0, 0.0, 0.0, 0.0);
|
// glClearColor (0.0, 0.0, 0.0, 0.0);
|
||||||
|
@@ -21,6 +21,7 @@
|
|||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#endif
|
#endif
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
using namespace Shared::Util;
|
using namespace Shared::Util;
|
||||||
using namespace Shared::PlatformCommon;
|
using namespace Shared::PlatformCommon;
|
||||||
|
@@ -43,10 +43,11 @@
|
|||||||
#endif // _WIN32
|
#endif // _WIN32
|
||||||
|
|
||||||
#include <GL/glew.h>
|
#include <GL/glew.h>
|
||||||
#ifndef _WIN32
|
|
||||||
//#include <boost/shared_ptr.hpp>
|
#if !defined(_WIN32) || defined(__MINGW32__)
|
||||||
#include <tr1/memory>
|
#include <tr1/memory>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
@@ -61,7 +62,7 @@ using std::cout;
|
|||||||
using std::endl;
|
using std::endl;
|
||||||
using std::string;
|
using std::string;
|
||||||
|
|
||||||
#ifdef _WIN32
|
#if defined(_WIN32)
|
||||||
using std::tr1::shared_ptr;
|
using std::tr1::shared_ptr;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -48,7 +48,11 @@
|
|||||||
#include <map>
|
#include <map>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
//#include <tr1/memory>
|
|
||||||
|
#if !defined(_WIN32) || defined(__MINGW32__)
|
||||||
|
#include <tr1/memory>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <GL/glew.h>
|
#include <GL/glew.h>
|
||||||
|
|
||||||
#include "Mathlib.h"
|
#include "Mathlib.h"
|
||||||
@@ -60,7 +64,7 @@ using std::string;
|
|||||||
using std::vector;
|
using std::vector;
|
||||||
using std::map;
|
using std::map;
|
||||||
|
|
||||||
#ifdef _WIN32
|
#if defined(_WIN32)
|
||||||
using std::tr1::shared_ptr;
|
using std::tr1::shared_ptr;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -33,10 +33,9 @@ typedef unsigned int uint32;
|
|||||||
typedef long long int64;
|
typedef long long int64;
|
||||||
typedef unsigned long long uint64;
|
typedef unsigned long long uint64;
|
||||||
|
|
||||||
//typedef uint8 byte;
|
|
||||||
|
|
||||||
}}//end namespace
|
}}//end namespace
|
||||||
|
|
||||||
|
#ifndef __MINGW32__
|
||||||
|
|
||||||
// ISO C9x compliant stdint.h for Microsoft Visual Studio
|
// ISO C9x compliant stdint.h for Microsoft Visual Studio
|
||||||
// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
|
// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
|
||||||
@@ -287,3 +286,5 @@ typedef uint64_t uintmax_t;
|
|||||||
#endif // _MSC_STDINT_H_ ]
|
#endif // _MSC_STDINT_H_ ]
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
@@ -25,6 +25,10 @@
|
|||||||
# include <string>
|
# include <string>
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
|
#ifdef __MINGW32__
|
||||||
|
typedef unsigned char byte;
|
||||||
|
#endif
|
||||||
|
|
||||||
//! \name Macros for Shared::Util::String
|
//! \name Macros for Shared::Util::String
|
||||||
//@{
|
//@{
|
||||||
|
|
||||||
|
@@ -1900,7 +1900,7 @@ void BroadCastClientSocketThread::execute() {
|
|||||||
#else
|
#else
|
||||||
setsockopt(bcfd, SOL_SOCKET, SO_REUSEADDR, (char *)&val, sizeof(val));
|
setsockopt(bcfd, SOL_SOCKET, SO_REUSEADDR, (char *)&val, sizeof(val));
|
||||||
#endif
|
#endif
|
||||||
if(bind( bcfd, (struct sockaddr *)&bcaddr, sizeof(bcaddr) ) < 0 ) {
|
if(::bind( bcfd, (struct sockaddr *)&bcaddr, sizeof(bcaddr) ) < 0 ) {
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"bind failed: %s\n", getLastSocketErrorFormattedText().c_str());
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"bind failed: %s\n", getLastSocketErrorFormattedText().c_str());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@@ -257,7 +257,15 @@ void init_win32() {
|
|||||||
|
|
||||||
HWND hwnd = wminfo.window;
|
HWND hwnd = wminfo.window;
|
||||||
|
|
||||||
::SetClassLong(hwnd, GCL_HICON, (LONG) icon);
|
#ifdef __MINGW32__
|
||||||
|
#define GCL_HICON -14
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __MINGW32__
|
||||||
|
LONG iconPtr = (LONG)icon;
|
||||||
|
|
||||||
|
::SetClassLong(hwnd, GCL_HICON, iconPtr);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
void done_win32() {
|
void done_win32() {
|
||||||
::DestroyIcon(icon);
|
::DestroyIcon(icon);
|
||||||
|
Reference in New Issue
Block a user