Skip to content

Commit

Permalink
Add xrUICore to cmake and fix builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Zegeri committed Oct 1, 2018
1 parent 87b3b8b commit 5365fe6
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 10 deletions.
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ add_subdirectory(Layers)
add_subdirectory(xr_3da)
#add_subdirectory(xrMisc)
add_subdirectory(xrAICore)
add_subdirectory(xrUICore)
add_subdirectory(xrCDB)
add_subdirectory(xrCore)
add_subdirectory(xrEngine)
Expand Down
4 changes: 2 additions & 2 deletions src/xrGame/ui/UIWindow_script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,18 @@ SCRIPT_EXPORT(SServerFilters, (), {
];
});

#ifndef LINUX // FIXME!!!
SCRIPT_EXPORT(connect_error_cb, (), {
module(luaState)
[
class_<connect_error_cb>("connect_error_cb")
.def(constructor<>())
.def(constructor<connect_error_cb::lua_object_type, connect_error_cb::lua_function_type>())
#ifndef LINUX // FIXME!!!
.def("bind", &connect_error_cb::bind)
#endif
.def("clear", &connect_error_cb::clear)
];
});
#endif

SCRIPT_EXPORT(CServerList, (CUIWindow), {
module(luaState)
Expand Down
21 changes: 17 additions & 4 deletions src/xrUICore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,16 @@ message("path " ${CMAKE_CURRENT_SOURCE_DIR})

add_definitions(-DXRUICORE_EXPORTS -D_SECURE_SCL=0)

add_compile_options(/fp:fast "/Yupch.hpp")
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/pch.cpp PROPERTIES COMPILE_FLAGS /Yc)
if (WIN32)
add_compile_options(/fp:fast "/Yupch.hpp")
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/pch.cpp PROPERTIES COMPILE_FLAGS /Yc)
endif()

if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
set(LUAJIT_LIBRARIES luajit-debug)
else()
set(LUAJIT_LIBRARIES luajit)
endif()

add_library(xrUICore SHARED ${ARROW} ${BUTTONS} ${CALLBACKS}
${COMBO_BOX} ${CURSOR}
Expand All @@ -75,5 +83,10 @@ add_library(xrUICore SHARED ${ARROW} ${BUTTONS} ${CALLBACKS}
${GENERAL})

set_target_properties(xrUICore PROPERTIES PREFIX "")
target_include_directories(xrUICore PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ../../Externals/lzo/include)
target_link_libraries(xrUICore xrAPI pugixml xrScriptEngine LuaJIT xrEngine xrMiscMath xrCore luabind)
target_include_directories(xrUICore PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/../
../../Externals/lzo/include
../../Externals/luabind
${SDL_INCLUDE_DIRS})
target_link_libraries(xrUICore xrAPI pugixml xrScriptEngine ${LUAJIT_LIBRARIES} xrEngine xrMiscMath xrCore luabind ${SDL_LIBRARIES})
2 changes: 1 addition & 1 deletion src/xrUICore/ComboBox/UIComboBox_script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "pch.hpp"
#include "UIComboBox.h"
#include "ListBox\UIListBoxItem.h"
#include "ListBox/UIListBoxItem.h"
#include "xrScriptEngine/ScriptExporter.hpp"

using namespace luabind;
Expand Down
1 change: 1 addition & 0 deletions src/xrUICore/ScrollBar/UIFixedScrollBar.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "pch.hpp"
#include "UIFixedScrollBar.h"
#include "Buttons/UI3tButton.h"
#include "Windows/UIFrameLineWnd.h"
#include "UIScrollBox.h"
Expand Down
2 changes: 1 addition & 1 deletion src/xrUICore/Static/UIStatic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "XML/UITextureMaster.h"
#include "xrEngine/LightAnimLibrary.h"
#include "Lines/uiLines.h"
#include "Lines/UILines.h"
#include "Include/xrRender/UIRender.h"
#include "Buttons/UIBtnHint.h"
#include "Cursor/UICursor.h"
Expand Down
2 changes: 1 addition & 1 deletion src/xrUICore/TabControl/UITabButton.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "pch.hpp"
#include "UITabButton.h"
#include "xrEngine\xr_input_xinput.h"
#include "xrEngine/xr_input_xinput.h"

CUITabButton::CUITabButton() {}
CUITabButton::~CUITabButton() {}
Expand Down
2 changes: 1 addition & 1 deletion src/xrUICore/Windows/UIWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "Cursor/UICursor.h"
#include "Include/xrRender/DebugRender.h"
#include "Include/xrRender/UIRender.h"
#include "xrEngine\xr_input_xinput.h"
#include "xrEngine/xr_input_xinput.h"

xr_vector<Frect> g_wnds_rects;
BOOL g_show_wnd_rect2 = FALSE;
Expand Down

0 comments on commit 5365fe6

Please sign in to comment.