mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 19:03:07 +02:00
more windows build tweaks, warnings and linking
This commit is contained in:
parent
3f03145386
commit
483ac66518
5 changed files with 42 additions and 4 deletions
|
@ -3,7 +3,9 @@ cmake_minimum_required(VERSION 2.8)
|
||||||
project(hifi)
|
project(hifi)
|
||||||
|
|
||||||
IF (WIN32)
|
IF (WIN32)
|
||||||
add_definitions( -DNOMINMAX -D_CRT_SECURE_NO_WARNINGS )
|
add_definitions( -DNOMINMAX -D_CRT_SECURE_NO_WARNINGS -DTEST)
|
||||||
|
#MESSAGE(${CMAKE_PREFIX_PATH})
|
||||||
|
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A")
|
||||||
ENDIF(WIN32)
|
ENDIF(WIN32)
|
||||||
|
|
||||||
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} $ENV{QT_CMAKE_PREFIX_PATH})
|
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} $ENV{QT_CMAKE_PREFIX_PATH})
|
||||||
|
|
|
@ -34,9 +34,13 @@ if (UNIX AND NOT APPLE)
|
||||||
endif (UNIX AND NOT APPLE)
|
endif (UNIX AND NOT APPLE)
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
|
MESSAGE(${CMAKE_PREFIX_PATH})
|
||||||
|
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A")
|
||||||
|
MESSAGE(${CMAKE_PREFIX_PATH})
|
||||||
|
|
||||||
add_definitions( -D_USE_MATH_DEFINES -DWINDOWS_LEAN_AND_MEAN ) # apparently needed to get M_PI and other defines from cmath/math.h
|
add_definitions( -D_USE_MATH_DEFINES -DWINDOWS_LEAN_AND_MEAN ) # apparently needed to get M_PI and other defines from cmath/math.h
|
||||||
|
|
||||||
#set(GLUT_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/external/glut)
|
set(GLUT_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/external/glut)
|
||||||
#set(GL_HEADERS "#define GLEW_STATIC\n#define FREEGLUT_STATIC\n#define FREEGLUT_LIB_PRAGMAS 0\n#include <GL/glew.h>\n#include <GL/wglew.h>\n#include <GL/freeglut_std.h>\n#include <GL/freeglut_ext.h>")
|
#set(GL_HEADERS "#define GLEW_STATIC\n#define FREEGLUT_STATIC\n#define FREEGLUT_LIB_PRAGMAS 0\n#include <GL/glew.h>\n#include <GL/wglew.h>\n#include <GL/freeglut_std.h>\n#include <GL/freeglut_ext.h>")
|
||||||
|
|
||||||
# this bit of #define GLdouble GLdouble is to fix up a mismatch between windows and the Qt versions of open GL.
|
# this bit of #define GLdouble GLdouble is to fix up a mismatch between windows and the Qt versions of open GL.
|
||||||
|
@ -233,7 +237,7 @@ if (WIN32)
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
${TARGET_NAME}
|
${TARGET_NAME}
|
||||||
#${CMAKE_CURRENT_SOURCE_DIR}/external/glut/Release/glew32.lib
|
#${CMAKE_CURRENT_SOURCE_DIR}/external/glut/Release/glew32.lib
|
||||||
#${CMAKE_CURRENT_SOURCE_DIR}/external/glut/Release/freeglut.lib
|
${CMAKE_CURRENT_SOURCE_DIR}/external/glut/Release/freeglut.lib
|
||||||
#${CMAKE_CURRENT_SOURCE_DIR}/external/glut/Release/pthread_lib.lib
|
#${CMAKE_CURRENT_SOURCE_DIR}/external/glut/Release/pthread_lib.lib
|
||||||
wsock32.lib
|
wsock32.lib
|
||||||
)
|
)
|
||||||
|
|
|
@ -318,11 +318,19 @@ public:
|
||||||
/// Declares the metatype and the streaming operators. The last lines
|
/// Declares the metatype and the streaming operators. The last lines
|
||||||
/// ensure that the generated file will be included in the link phase.
|
/// ensure that the generated file will be included in the link phase.
|
||||||
#define STRINGIFY(x) #x
|
#define STRINGIFY(x) #x
|
||||||
|
#ifdef _WIN32
|
||||||
|
#define DECLARE_STREAMABLE_METATYPE(X) Q_DECLARE_METATYPE(X) \
|
||||||
|
Bitstream& operator<<(Bitstream& out, const X& obj); \
|
||||||
|
Bitstream& operator>>(Bitstream& in, X& obj); \
|
||||||
|
static const int* _TypePtr##X = &X::Type;
|
||||||
|
#else
|
||||||
|
#define STRINGIFY(x) #x
|
||||||
#define DECLARE_STREAMABLE_METATYPE(X) Q_DECLARE_METATYPE(X) \
|
#define DECLARE_STREAMABLE_METATYPE(X) Q_DECLARE_METATYPE(X) \
|
||||||
Bitstream& operator<<(Bitstream& out, const X& obj); \
|
Bitstream& operator<<(Bitstream& out, const X& obj); \
|
||||||
Bitstream& operator>>(Bitstream& in, X& obj); \
|
Bitstream& operator>>(Bitstream& in, X& obj); \
|
||||||
static const int* _TypePtr##X = &X::Type; \
|
static const int* _TypePtr##X = &X::Type; \
|
||||||
_Pragma(STRINGIFY(unused(_TypePtr##X)))
|
_Pragma(STRINGIFY(unused(_TypePtr##X)))
|
||||||
|
#endif
|
||||||
|
|
||||||
/// Registers a streamable type and its streamer.
|
/// Registers a streamable type and its streamer.
|
||||||
template<class T> int registerStreamableMetaType() {
|
template<class T> int registerStreamableMetaType() {
|
||||||
|
|
|
@ -36,6 +36,12 @@ Assignment::Type Assignment::typeForNodeType(NODE_TYPE nodeType) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
//warning C4351: new behavior: elements of array 'Assignment::_payload' will be default initialized
|
||||||
|
// We're disabling this warning because the new behavior which is to initialize the array with 0 is acceptable to us.
|
||||||
|
#pragma warning(disable:4351)
|
||||||
|
#endif
|
||||||
|
|
||||||
Assignment::Assignment() :
|
Assignment::Assignment() :
|
||||||
_uuid(),
|
_uuid(),
|
||||||
_command(Assignment::RequestCommand),
|
_command(Assignment::RequestCommand),
|
||||||
|
@ -106,6 +112,11 @@ Assignment::Assignment(const unsigned char* dataBuffer, int numBytes) :
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
#pragma warning(default:4351)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
Assignment::Assignment(const Assignment& otherAssignment) {
|
Assignment::Assignment(const Assignment& otherAssignment) {
|
||||||
|
|
||||||
_uuid = otherAssignment._uuid;
|
_uuid = otherAssignment._uuid;
|
||||||
|
|
|
@ -51,6 +51,13 @@ NodeList* NodeList::getInstance() {
|
||||||
return _sharedInstance;
|
return _sharedInstance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
//warning C4351: new behavior: elements of array 'NodeList::_nodeBuckets' will be default initialized
|
||||||
|
// We're disabling this warning because the new behavior which is to initialize the array with 0 is acceptable to us.
|
||||||
|
#pragma warning(disable:4351)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
NodeList::NodeList(char newOwnerType, unsigned short int newSocketListenPort) :
|
NodeList::NodeList(char newOwnerType, unsigned short int newSocketListenPort) :
|
||||||
_domainHostname(DEFAULT_DOMAIN_HOSTNAME),
|
_domainHostname(DEFAULT_DOMAIN_HOSTNAME),
|
||||||
_domainSockAddr(HifiSockAddr(QHostAddress::Null, DEFAULT_DOMAIN_SERVER_PORT)),
|
_domainSockAddr(HifiSockAddr(QHostAddress::Null, DEFAULT_DOMAIN_SERVER_PORT)),
|
||||||
|
@ -70,6 +77,12 @@ NodeList::NodeList(char newOwnerType, unsigned short int newSocketListenPort) :
|
||||||
qDebug() << "NodeList socket is listening on" << _nodeSocket.localPort() << "\n";
|
qDebug() << "NodeList socket is listening on" << _nodeSocket.localPort() << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
//warning C4351: new behavior: elements of array 'NodeList::_nodeBuckets' will be default initialized
|
||||||
|
#pragma warning(default:4351)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
NodeList::~NodeList() {
|
NodeList::~NodeList() {
|
||||||
delete _nodeTypesOfInterest;
|
delete _nodeTypesOfInterest;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue