Commit ef632ca4 authored by nanahira's avatar nanahira

improve libevent build

parent 13745bf0
......@@ -56,7 +56,7 @@ mat_linux:
- wget -O - https://cdn01.moecube.com/ygopro-build-materials/premake-5.0.0-alpha14-linux.tar.gz | tar zfx -
- wget -O - https://cdn01.moecube.com/ygopro-build-materials/libevent-2.0.22-stable.tar.gz | tar zfx -
- cd libevent-2.0.22-stable
- ./configure --prefix=$PWD/libevent-stable --disable-openssl
- ./configure --prefix=$PWD/libevent-stable --disable-openssl --enable-static=yes --enable-shared=no
- make -j$(nproc)
- make install
- cd ..
......@@ -140,8 +140,6 @@ exec_linux:
- linux
variables:
YGOPRO_BUILD_ALL: '1'
YGOPRO_LINUX_ALL_STATIC: '1'
YGOPRO_LINUX_ALL_STATIC_LIB_PATH: '/usr/lib/x86_64-linux-gnu/'
dependencies:
- mat_common
- mat_irrklang
......@@ -155,7 +153,7 @@ exec_linux:
- git submodule update --init
- mkdir lib
- cp -rf irrklang/bin/linux-gcc-64/libIrrKlang.so ./lib/
- YGOPRO_LINUX_ALL_STATIC_LIBEVENT_PATH=$PWD/libevent-stable ./premake5 gmake
- env YGOPRO_LIBEVENT_STATIC_PATH=$PWD/libevent-stable ./premake5 gmake
- cd build
- make config=release -j$(nproc)
- cd ..
......
......@@ -7,10 +7,7 @@ project "ygopro"
files { "**.cpp", "**.cc", "**.c", "**.h" }
excludes { "lzma/**", "spmemvfs/**" }
includedirs { "../ocgcore" }
links { "ocgcore", "clzma", "cspmemvfs", "Irrlicht", "sqlite3", "freetype" }
if not LINUX_ALL_STATIC then
links { "event" }
end
links { "ocgcore", "clzma", "cspmemvfs", "Irrlicht", "sqlite3", "freetype", "event" }
if USE_IRRKLANG then
defines { "YGOPRO_USE_IRRKLANG" }
links { "ikpmp3" }
......@@ -28,10 +25,6 @@ project "ygopro"
local mr=os.getenv("YGOPRO_DEFAULT_DUEL_RULE")
if mr and tonumber(mr) then defines { "DEFAULT_DUEL_RULE="..tonumber(mr) } end
configuration "not linux"
if LINUX_ALL_STATIC then
links { "event" }
end
configuration "windows"
files "ygopro.rc"
excludes "CGUIButton.cpp"
......@@ -59,9 +52,11 @@ project "ygopro"
configuration "not windows"
excludes { "COSOperator.*" }
links { "dl", "pthread" }
if not LINUX_ALL_STATIC then
links { "event_pthreads" }
if LIBEVENT_ROOT then
includedirs { LIBEVENT_ROOT.."/include" }
libdirs { LIBEVENT_ROOT.."/lib/" }
end
links { "event_pthreads" }
if BUILD_SQLITE then
includedirs { "../sqlite3" }
end
......@@ -81,14 +76,6 @@ project "ygopro"
links { "lua5.3-c++" }
end
links { "X11", "Xxf86vm" }
if LINUX_ALL_STATIC then
local libeventRootPrefix=LIB_ROOT
if LIBEVENT_ROOT then
includedirs { LIBEVENT_ROOT.."/include" }
libeventRootPrefix=LIBEVENT_ROOT.."/lib/"
end
linkoptions { libeventRootPrefix.."libevent.a", libeventRootPrefix.."libevent_pthreads.a" }
end
if USE_IRRKLANG then
links { "IrrKlang" }
libdirs { "../irrklang/bin/linux-gcc-64" }
......@@ -97,6 +84,9 @@ project "ygopro"
links { "lua" }
includedirs { "../irrlicht/include" }
libdirs { "../irrlicht" }
if MAC_ARM then
buildoptions { "--target=arm64-apple-macos11" }
end
if USE_IRRKLANG then
links { "irrklang" }
libdirs { "../irrklang/bin/macosx-gcc" }
......
Subproject commit 4fce02f2c2889645af14f62f198322f18d19f17a
Subproject commit 62a5cb65ea7c392f00c2515d023d04a5229907a4
......@@ -2,12 +2,6 @@ solution "ygo"
location "build"
language "C++"
objdir "obj"
if (os.ishost("windows") or os.getenv("USE_IRRKLANG")) and not os.getenv("NO_IRRKLANG") then
USE_IRRKLANG = true
if os.getenv("irrklang_pro") then
IRRKLANG_PRO = true
end
end
if not os.ishost("windows") then
if os.getenv("YGOPRO_BUILD_LUA") then
BUILD_LUA=true
......@@ -21,17 +15,25 @@ solution "ygo"
if os.getenv("YGOPRO_BUILD_ALL") or os.ishost("macosx") then
BUILD_ALL=true
end
if os.ishost("linux") and os.getenv("YGOPRO_LINUX_ALL_STATIC") then
BUILD_ALL=true
LINUX_ALL_STATIC=true
LIB_ROOT=os.getenv("YGOPRO_LINUX_ALL_STATIC_LIB_PATH") or "/usr/lib/x86_64-linux-gnu/"
LIBEVENT_ROOT=os.getenv("YGOPRO_LINUX_ALL_STATIC_LIBEVENT_PATH")
if os.getenv("YGOPRO_LIBEVENT_STATIC_PATH") then
LIBEVENT_ROOT=os.getenv("YGOPRO_LIBEVENT_STATIC_PATH")
end
if BUILD_ALL then
BUILD_LUA=true
BUILD_SQLITE=true
BUILD_FREETYPE=true
end
if os.ishost("macosx") then
if os.getenv("YGOPRO_TARGET_ARM") then
MAC_ARM=true
end
end
end
if (os.ishost("windows") or os.getenv("USE_IRRKLANG")) and not os.getenv("NO_IRRKLANG") then
USE_IRRKLANG = true
if os.getenv("irrklang_pro") then
IRRKLANG_PRO = true
end
end
configurations { "Release", "Debug" }
......@@ -66,9 +68,14 @@ end
configuration "macosx"
defines { "LUA_USE_MACOSX", "DBL_MAX_10_EXP=+308", "DBL_MANT_DIG=53", "GL_SILENCE_DEPRECATION" }
includedirs { "/usr/local/include/event2", }
if not LIBEVENT_ROOT then
includedirs { "/usr/local/include/event2" }
end
libdirs { "/usr/local/lib" }
buildoptions { "-stdlib=libc++" }
if MAC_ARM then
buildoptions { "--target=arm64-apple-macos11" }
end
links { "OpenGL.framework", "Cocoa.framework", "IOKit.framework" }
configuration "linux"
......@@ -92,7 +99,9 @@ end
configuration { "Release", "not vs*" }
symbols "On"
defines "NDEBUG"
buildoptions "-march=native"
if not MAC_ARM then
buildoptions "-march=native"
end
configuration { "Debug", "vs*" }
defines { "_ITERATOR_DEBUG_LEVEL=0" }
......
Subproject commit baa705cbad1239663c55db63aa8cd69eccf4c65c
Subproject commit eae593f91a9e1c71649ab8d7463ffc0da97b8abe
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment