From f0d98ad70d2188197be00f6c1a9b7338473c6485 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Tue, 18 Dec 2018 20:10:10 -0500 Subject: Various fixes to get things working under msys2 Replaced various "make" calls in the makefile with $(MAKE) Replaced a few __mingw_printf with just printf Added some instructions to the readme --- src/shared/lua_api/load_net.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/shared') diff --git a/src/shared/lua_api/load_net.cpp b/src/shared/lua_api/load_net.cpp index 4baf952..677f1d1 100644 --- a/src/shared/lua_api/load_net.cpp +++ b/src/shared/lua_api/load_net.cpp @@ -313,7 +313,7 @@ void gameloop_net(lua_State* L){ luaL_getmetatable(L,"net.stream");//func,{data=stream} lua_setmetatable(L,-2);//func,{stream} lua_call(L,1,0);// - __mingw_printf("Finished calling gameloop, buf is %p, size is %zu\n",buf,size); + printf("Finished calling gameloop, buf is %p, size is %zu\n",buf,size); nng_msg_free(msgp); printf("called nn_freemsg\n"); free(stream);//We manually set stream->data so free_stream would crash here -- cgit v1.2.3-70-g09d2 From 2be63de9e9cf8e201627fecad37acd0f1a4a6757 Mon Sep 17 00:00:00 2001 From: Alexander Date: Wed, 9 Jan 2019 16:59:36 -0500 Subject: Started automating makefile Started working on some of the harder parts of building dependencies with the makefile. bullet, irrlicht, and luajit all currently are built automatically on windows under msys2 --- .gitmodules | 6 ++++++ Makefile | 27 ++++++++++++++++----------- lib/nng | 1 + lib/tinyobjloader-c | 1 + src/client/lua_api/gui/iguielement.cpp | 2 +- src/shared/lua_api/load_net.cpp | 2 +- 6 files changed, 26 insertions(+), 13 deletions(-) create mode 160000 lib/nng create mode 160000 lib/tinyobjloader-c (limited to 'src/shared') diff --git a/.gitmodules b/.gitmodules index 450740d..86d0d15 100644 --- a/.gitmodules +++ b/.gitmodules @@ -8,3 +8,9 @@ [submodule "lib/luajit"] path = lib/luajit url = https://gitlab.com/bbblitz/luajit/ +[submodule "lib/tinyobjloader-c"] + path = lib/tinyobjloader-c + url = http://cogarr.net/source/cgit.cgi/tinyobjloader-c/ +[submodule "lib/nng"] + path = lib/nng + url = http://cogarr.net/source/cgit.cgi/nng/ diff --git a/Makefile b/Makefile index 556179c..df20c70 100644 --- a/Makefile +++ b/Makefile @@ -221,7 +221,7 @@ ifeq ($(UNAME), Windows) IRRMAKEFLAGS=staticlib_win32 IRRMADELIB=$(LIRRDIR)/lib/Win32-gcc endif - IRRMAKEFLAGS+=NO_IRR_COMPILE_WITH_DIRECT3D_9_ + IRRMAKEFLAGS+=-DNO_IRR_COMPILE_WITH_DIRECT3D_9_ else IRRMADELIB=$(LIRRDIR)/lib/Linux endif @@ -236,6 +236,7 @@ $(LIB_S_IRR) : $(IRRMADELIB)/libIrrlicht.a cp $^ $@ $(IRRMADELIB)/libIrrlicht.a : $(LIRRDIR)/source/Irrlicht/Makefile + sed --in-place=OLD '107s/ -ld3dx9d//' lib/irrlicht/source/Irrlicht/Makefile cd $(LIRRDIR)/source/Irrlicht && $(MAKE) $(IRRMAKEFLAGS) $(LIB_D_IRR) : $(IRRMADELIB)/Irrlicht$(DYN_LIB_EXT) @@ -246,6 +247,7 @@ $(BIN_DIR)/$(CLIENTNAME)/bin/Irrlicht$(DYN_LIB_EXT) : $(IRRMADELIB)/Irrlicht$(DY cp $^ $@ $(IRRMADELIB)/Irrlicht$(DYN_LIB_EXT) : $(LIRRDIR)/source/Irrlicht/Makefile + sed --in-place=OLD '107s/ -ld3dx9d//' lib/irrlicht/source/Irrlicht/Makefile cd $(LIRRDIR)/source/Irrlicht && $(MAKE) $(IRRMAKEFLAGS) ifeq ($(UNAME),Windows) @@ -276,22 +278,22 @@ $(LIB_D_LUA) : $(LLUADIR)/src/lua51$(DYN_LIB_EXT) cp $^ $@ # Library - Bullet -$(LBULDIR)/src/BulletCollision/libBulletCollision.a : $(LBULDIR)/Makefile +$(LBULDIR)/lib/libBulletCollision.a : $(LBULDIR)/Makefile cd $(LBULDIR) && $(MAKE) BulletCollision -$(LBULDIR)/src/BulletDynamics/libBulletDynamics.a : $(LBULDIR)/Makefile +$(LBULDIR)/lib/libBulletDynamics.a : $(LBULDIR)/Makefile cd $(LBULDIR) && $(MAKE) BulletDynamics -$(LBULDIR)/src/LinearMath/libLinearMath.a : $(LBULDIR)/Makefile +$(LBULDIR)/lib/libLinearMath.a : $(LBULDIR)/Makefile cd $(LBULDIR) && $(MAKE) LinearMath -$(LIB_D_BCO) : $(LBULDIR)/src/BulletCollision/libBulletCollision.a +$(LIB_D_BCO) : $(LBULDIR)/lib/libBulletCollision.a cp $^ $@ -$(LIB_D_BDY) : $(LBULDIR)/src/BulletDynamics/libBulletDynamics.a +$(LIB_D_BDY) : $(LBULDIR)/lib/libBulletDynamics.a cp $^ $@ -$(LIB_D_BLM) : $(LBULDIR)/src/LinearMath/libLinearMath.a +$(LIB_D_BLM) : $(LBULDIR)/lib/libLinearMath.a cp $^ $@ $(LBULDIR)/Makefile : $(LBULDIR)/CMakeLists.txt @@ -311,14 +313,17 @@ $(LNNGDIR)/dynamic : $(LNNGDIR)/CMakeLists.txt $(LNNGDIR)/dynamic/Makefile : $(LNNGDIR)/dynamic cd $< && cmake $(CMAKE_FLAGS) -DBUILD_SHARED_LIBS="TRUE" ../ -$(LIB_S_NNG) : $(LNNGDIR)/static/libnng$(STA_LIB_EXT) +$(LIB_S_NNG) : $(LNNGDIR)/static/libnng$(STA_LIB_EXT) $(LNNGDIR)/static cp $^ $@ -$(LIB_D_NNG) : $(LNNGDIR)/dynamic/libnng$(DYN_LIB_EXT) +$(LIB_D_NNG) : $(LNNGDIR)/dynamic/libnng$(DYN_LIB_EXT) $(LNNGDIR)/static cp $^ $@ -$(LNNGDIR)/libnng$(DYN_LIB_EXT) : $(LNNGDIR)/Makefile - cd $(LNNGDIR) && $(MAKE) nng +$(LNNGDIR)/static/libnng$(STA_LIB_EXT) : $(LNNGDIR)/static $(LNNGDIR)/static/Makefile + $(LNNGDIR)/static/Makefile + +$(LNNGDIR)/dynamic/libnng$(DYN_LIB_EXT) : $(LNNGDIR)/dynamic $(LNNGDIR)/dynamic/Makefile + $(LNNGDIR)/dynamic/Makefile $(LNNGDIR)/Makefile : $(LNNGDIR)/CMakeLists.txt @echo "LIB_OBJS were $(LIB_OBJS)" diff --git a/lib/nng b/lib/nng new file mode 160000 index 0000000..ccc24a8 --- /dev/null +++ b/lib/nng @@ -0,0 +1 @@ +Subproject commit ccc24a8e508131a2226474642a038baaa2cbcc8c diff --git a/lib/tinyobjloader-c b/lib/tinyobjloader-c new file mode 160000 index 0000000..226ea08 --- /dev/null +++ b/lib/tinyobjloader-c @@ -0,0 +1 @@ +Subproject commit 226ea087b7ba5d699ab3c396ddd4ae4829a706da diff --git a/src/client/lua_api/gui/iguielement.cpp b/src/client/lua_api/gui/iguielement.cpp index 4d53ca2..7e8163d 100644 --- a/src/client/lua_api/gui/iguielement.cpp +++ b/src/client/lua_api/gui/iguielement.cpp @@ -177,7 +177,7 @@ int getiguitext(lua_State* L){ lua_pop(L,2);// const wchar_t *t = el->getText(); size_t cstrlen = wcslen(t); - printf("In gui get text, cstrlen is %zu\n",cstrlen); + //printf("In gui get text, cstrlen is %zu\n",cstrlen); char output[cstrlen + 1];//+1 for \0 wcstombs(output,t,cstrlen); output[cstrlen] = '\0'; diff --git a/src/shared/lua_api/load_net.cpp b/src/shared/lua_api/load_net.cpp index 677f1d1..4b8475f 100644 --- a/src/shared/lua_api/load_net.cpp +++ b/src/shared/lua_api/load_net.cpp @@ -313,7 +313,7 @@ void gameloop_net(lua_State* L){ luaL_getmetatable(L,"net.stream");//func,{data=stream} lua_setmetatable(L,-2);//func,{stream} lua_call(L,1,0);// - printf("Finished calling gameloop, buf is %p, size is %zu\n",buf,size); + //printf("Finished calling gameloop, buf is %p, size is %zu\n",buf,size); nng_msg_free(msgp); printf("called nn_freemsg\n"); free(stream);//We manually set stream->data so free_stream would crash here -- cgit v1.2.3-70-g09d2