Skip to content

Commit

Permalink
travis: add library instalation
Browse files Browse the repository at this point in the history
add CMakeLists.txt for xrRenderPC_GL xr_3da, fixed depency in xrAPI, xrCore, xrEngine, xrSound
  • Loading branch information
eagleivg committed Jun 8, 2018
1 parent e563333 commit fa8cb46
Show file tree
Hide file tree
Showing 13 changed files with 141 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ os:
- linux
before_script:
- g++ --version
- sudo apt-get install libegl1-mesa-dev libgles2-mesa-dev
- sudo apt-get install libegl1-mesa-dev libgles2-mesa-dev libpugixml-dev libopenal-dev libtbb-dev
- sudo apt-get install cmake lua5.1-dev libssl-dev libogg-dev libtheora-dev libvorbis-dev libsdl2-dev liblzo2-dev libjpeg-dev libncurses5-dev
- mkdir bin
- cd bin
Expand Down
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
add_subdirectory(utils)
add_subdirectory(Layers)
#add_subdirectory(xr_3da)
#add_subdirectory(xrMisc)
#add_subdirectory(xrAICore)
add_subdirectory(xrCDB)
Expand Down
22 changes: 22 additions & 0 deletions src/Common/PlatformLinux.inl
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,28 @@ typedef struct {
WORD cbSize;
} WAVEFORMATEX, *LPWAVEFORMATEX;

typedef struct tagSTICKYKEYS
{
DWORD cbSize;
DWORD dwFlags;
} STICKYKEYS, *LPSTICKYKEYS;

typedef struct tagFILTERKEYS
{
UINT cbSize;
DWORD dwFlags;
DWORD iWaitMSec;
DWORD iDelayMSec;
DWORD iRepeatMSec;
DWORD iBounceMSec;
} FILTERKEYS, *LPFILTERKEYS;

typedef struct tagTOGGLEKEYS
{
DWORD cbSize;
DWORD dwFlags;
} TOGGLEKEYS, *LPTOGGLEKEYS;

typedef struct _EXCEPTION_POINTERS {
} EXCEPTION_POINTERS, *PEXCEPTION_POINTERS;

Expand Down
5 changes: 5 additions & 0 deletions src/Layers/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
add_subdirectory(xrAPI)
#add_subdirectory(xrRenderPC_R1)
#add_subdirectory(xrRenderPC_R2)
#add_subdirectory(xrRenderPC_R3)
#add_subdirectory(xrRenderPC_R4)
#add_subdirectory(xrRenderPC_GL)
7 changes: 5 additions & 2 deletions src/Layers/xrAPI/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
project(xrAPI)

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../.. ${CMAKE_CURRENT_SOURCE_DIR}/../../../sdk/include)

add_library(xrAPI SHARED "xrAPI.cpp" "stdafx.h")
add_definitions(-DXRAPI_EXPORTS)

set_target_properties(xrAPI PROPERTIES PREFIX "")
add_library(${PROJECT_NAME} SHARED "xrAPI.cpp" "stdafx.h")
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
23 changes: 23 additions & 0 deletions src/Layers/xrRenderPC_GL/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
project(xrRenderPC_GL)

list(APPEND DIRS
"."
)


add_dir("${DIRS}")

include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/../..
${CMAKE_CURRENT_SOURCE_DIR}/../../../Externals/luabind
${CMAKE_CURRENT_SOURCE_DIR}/../../../sdk/include
)

#list(REMOVE_ITEM ${PROJECT_NAME}__SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/./LevelCompilerLoggerWindow.cpp")
#list(REMOVE_ITEM ${PROJECT_NAME}__INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/./LevelCompilerLoggerWindow.hpp")

add_definitions(-DXRLCUTIL_EXPORTS -D_USRDLL -DXRRENDER_GL_EXPORTS -DUSE_OGL -DNO_XR_VDECLARATOR)
add_library(${PROJECT_NAME} SHARED ${${PROJECT_NAME}__SOURCES} ${${PROJECT_NAME}__INCLUDES})

set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
target_link_libraries(${PROJECT_NAME} xrCore luabind LuaJIT xrCDB xrEngine xrParticles xrScriptEngine xrAPI)
8 changes: 7 additions & 1 deletion src/xrCore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,10 @@ add_definitions(-DXRCORE_EXPORTS)
add_library(${PROJECT_NAME} SHARED ${${PROJECT_NAME}__SOURCES} ${${PROJECT_NAME}__INCLUDES})

set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
target_link_libraries(${PROJECT_NAME} ${SDL2_LIB} ${OPENSSL_LIBRARIES} ${LZO_LIBRARY} ${CRYPTO_LIBRARY} ${PUGIXML_LIBRARY})
#Заглушки, пока не починю find_package
set(CRYPTO_LIBRARY crypto++)
set(PUGIXML_LIBRARY pugixml)
set(TBB_LIBRARIES tbb tbbmalloc_proxy tbbmalloc)
set(SDL2_LIB SDL2)

target_link_libraries(${PROJECT_NAME} ${SDL2_LIB} ${LZO_LIBRARY} ${CRYPTO_LIBRARY} ${PUGIXML_LIBRARY} ${TBB_LIBRARIES})
4 changes: 0 additions & 4 deletions src/xrCore/string_concatenations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
#include "string_concatenations.h"

#if defined(LINUX)
#define EXCEPTION_STACK_OVERFLOW ((DWORD) 0xC00000FD)
#define EXCEPTION_EXECUTE_HANDLER 1
#define EXCEPTION_CONTINUE_SEARCH 0

int _cdecl _resetstkoflw(void)
{
int stack_addr;
Expand Down
8 changes: 8 additions & 0 deletions src/xrCore/string_concatenations.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
#ifndef STRING_CONCATENATIONS_H
#define STRING_CONCATENATIONS_H

#if defined(LINUX)
#define EXCEPTION_STACK_OVERFLOW ((DWORD) 0xC00000FD)
#define EXCEPTION_EXECUTE_HANDLER 1
#define EXCEPTION_CONTINUE_SEARCH 0

int _cdecl _resetstkoflw(void);
#endif

#if 1//ndef _EDITOR

pstr XRCORE_API strconcat(int dest_sz, pstr dest, pcstr S1, pcstr S2);
Expand Down
2 changes: 1 addition & 1 deletion src/xrEngine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ add_definitions(-DENGINE_BUILD)
add_library(${PROJECT_NAME} SHARED ${${PROJECT_NAME}__SOURCES} ${${PROJECT_NAME}__INCLUDES})

set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
target_link_libraries(${PROJECT_NAME} xrCore luabind xrAPI xrSound xrScriptEngine LuaJIT xrCDB xrPhysics)
target_link_libraries(${PROJECT_NAME} xrCore luabind xrAPI xrSound xrScriptEngine luajit theora ${OGG_LIBRARIES} xrNetServer xrCDB xrPhysics openal)
2 changes: 1 addition & 1 deletion src/xrSound/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ add_definitions(-DXRSOUND_EXPORTS -DdSINGLE -D_SECURE_SCL=0)
add_library(${PROJECT_NAME} SHARED ${${PROJECT_NAME}__SOURCES} ${${PROJECT_NAME}__INCLUDES})

set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
#target_link_libraries(${PROJECT_NAME} xrCore ogg vorbis vorbisfile openal xrAPI xrCDB)
#target_link_libraries(${PROJECT_NAME} xrCore ${OGG_LIBRARIES} vorbis vorbisfile openal xrAPI xrCDB)
target_link_libraries(${PROJECT_NAME} xrCore xrAPI xrCDB)
20 changes: 20 additions & 0 deletions src/xr_3da/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
project(xr_3da)

list(APPEND DIRS
"."
)

add_dir("${DIRS}")

include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/..
${CMAKE_CURRENT_SOURCE_DIR}/../../Externals/ode/include
${CMAKE_CURRENT_SOURCE_DIR}/../../sdk/include
)

list(REMOVE_ITEM ${PROJECT_NAME}__SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/./StickyKeyFilter.hpp")

add_executable(${PROJECT_NAME} ${${PROJECT_NAME}__SOURCES} ${${PROJECT_NAME}__INCLUDES})

set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
target_link_libraries(${PROJECT_NAME} xrCore xrAPI xrEngine)
49 changes: 47 additions & 2 deletions src/xr_3da/entry_point.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
#include "stdafx.h"
#include "resource.h"
#if defined(WINDOWS)
#include "StickyKeyFilter.hpp"

#elif defined(LINUX)
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <getopt.h>
#endif
#include "xrEngine/main.h"
#include "xrEngine/splash.h"

Expand All @@ -21,10 +27,11 @@ int entry_point(pcstr commandLine)
GEnv.isDedicatedServer = true;

xrDebug::Initialize(GEnv.isDedicatedServer);

#ifdef WINDOWS
StickyKeyFilter filter;
if (!GEnv.isDedicatedServer)
filter.initialize();
#endif

pcstr fsltx = "-fsltx ";
string_path fsgame = "";
Expand All @@ -42,6 +49,7 @@ int entry_point(pcstr commandLine)
return result;
}

#if defined(WINDOWS)
int StackoverflowFilter(const int exceptionCode)
{
if (exceptionCode == EXCEPTION_STACK_OVERFLOW)
Expand All @@ -64,3 +72,40 @@ int APIENTRY WinMain(HINSTANCE inst, HINSTANCE prevInst, char* commandLine, int
}
return result;
}
#elif defined(LINUX)
int main(int argc, char *argv[])
{
int result = EXIT_FAILURE;

try
{
char* commandLine = NULL;
int i;
if(argc > 1)
{
size_t sum = 0;
for(i = 1; i < argc; ++i)
sum += strlen(argv[i]) + 1;

commandLine = malloc(sum);
memset(commandLine, 0, sum);

for(i = 1; i < argc; ++i)
{
strcat(commandLine, argv[i]);
strcat(commandLine, " ");
}
}

result = entry_point(commandLine);

free(commandLine);
}
catch (...)
{
_resetstkoflw();
FATAL("stack overflow");
}
return result;
}
#endif

0 comments on commit fa8cb46

Please sign in to comment.