代码拉取完成,页面将自动刷新
同步操作将从 Li Jin/Dorothy 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
local function runCmd(...)
local cmd = string.format(...)
print('>>>', cmd)
os.execute(cmd)
end
if not _PREMAKE_VERSION then
runCmd('premake5 tolua')
runCmd('premake5 vs2015')
runCmd('premake5 androidmk')
return
end
local module_defines = {
["androidmk"] = 'https://github.com/Meoo/premake-androidmk.git',
}
local function import(name)
if not os.isfile(name .. "/" .. name .. '.lua') then
error(string.format('Module %s[%s] should clone into %s first.', name, module_defines[name], name))
end
require(name .. "." .. name)
end
import "androidmk"
newaction {
trigger = "tolua",
description = "binding cpp to lua",
execute = function ()
if os.is('windows') then
local cmds = {
'cd tools\\tolua++',
'tolua++ -t -D -L basic.lua -o "../../lua/support/LuaCocos2d.cpp" Cocos2d.pkg',
'tolua++ -t -D -L basic.lua -o "../../lua/support/LuaCode.cpp" LuaCode.pkg',
}
runCmd(table.concat(cmds, ' & '))
else
error "this action not impl yet."
end
end
}
newaction {
trigger = 'ndkbuild',
description = "android ndk build.",
execute = function ()
local APP_ANDROID_ROOT = path.join(os.getcwd(), 'project', 'proj.android')
local NDK_DEBUG = 1
local NDK_MODULE_PATH = {
os.getcwd(),
}
runCmd("cd project\\proj.android &ndk-build -j")-- NDK_DEBUG=%d -C %s NDK_MODULE_PATH=%s", NDK_DEBUG, APP_ANDROID_ROOT, table.concat(NDK_MODULE_PATH, ';'))
end
}
newaction {
trigger = 'apk',
description = 'pack apk.',
execute = function()
runCmd("gradlew build")
end
}
newoption
{
trigger = "to",
value = "path",
description = "Set the output location for the generated files"
}
-- platform in [windows, android, ios, macosx ... ]
-- because there is no andoird ios in the premake os list.
local os_list = {
windows = function() filter { "system:windows", "action:vs*" } end,
android = function() filter { "action:androidmk" } end,
}
local function is_build_to(to)
os_list[to]()
end
solution "DorothyPremake"
configurations { "Debug", "Release" }
location (path.join(_OPTIONS['to'] or "build", _ACTION))
language "C++"
includedirs {
"cocos2dx",
"cocos2dx/include",
"cocos2dx/extensions",
"cocos2dx/kazmath/include",
"cocos2dx/platform",
"external/sqlite3/include",
"external/Box2D",
"external",
"cocosDenshion/include",
}
defines { "COCOS2D_STATIC", }
configuration "Debug"
targetdir "bin/debug"
objdir "bin/obj/debug"
defines { "_DEBUG","COCOS2D_DEBUG=1" }
flags { "Symbols" }
configuration "Release"
targetdir "bin/release"
objdir "bin/obj/release"
defines { "NDEBUG" }
flags { "OptimizeSize" }
filter "action:vs*"
buildoptions { "/MTd" }
defines { "_CRT_SECURE_NO_WARNINGS" }
is_build_to "windows"
defines { "_WINDOWS", "WIN32", }
includedirs {
"cocos2dx/platform/win32",
"cocos2dx/platform/third_party/win32",
"cocos2dx/platform/third_party/win32/*",
}
is_build_to "android"
ndkabi "armeabi"
ndkplatform "android-19"
ndktoolchainversion "default"
defines { "USE_FILE32API" }
includedirs {
"cocos2dx/platform/android",
"cocos2dx/platform/third_party/android/prebuilt/libcurl/include",
}
project "libCocos2d"
kind "StaticLib"
files {
"cocos2dx/**.c",
"cocos2dx/**.cpp",
"cocos2dx/**.h",
}
is_build_to "windows"
excludes {
"cocos2dx/platform/third_party/**.*",
"cocos2dx/platform/ios/**.*",
"cocos2dx/platform/android/**.*",
"cocos2dx/platform/mac/**.*",
}
is_build_to "android"
excludes {
"cocos2dx/platform/third_party/**.*",
"cocos2dx/platform/ios/**.*",
"cocos2dx/platform/win32/**.*",
"cocos2dx/platform/mac/**.*",
}
project "libDorothy"
kind "StaticLib"
files {
"dorothy/**.cpp",
"dorothy/**.h",
}
includedirs {
"dorothy"
}
project "libBox2D"
kind "StaticLib"
files {
"external/Box2D/**.cpp",
"external/Box2D/**.h",
}
project "libLua"
kind "StaticLib"
files {
"lua/**.c",
"lua/**.cpp",
"lua/**.h",
}
local lua_inc = {
"lua",
"lua/tolua",
"lua/support",
"lua/lpeg",
"lua/lib/include",
"dorothy",
}
includedirs (lua_inc)
project "libCocosDenshion"
kind "StaticLib"
files { "cocosDenshion/include/*.*", }
is_build_to "windows"
files { "cocosDenshion/win32/*.*", }
is_build_to "android"
files { "cocosDenshion/android/*.*", }
project "Editor"
debugdir "project/Resources"
files { "project/Classes/*.cpp", }
links {
"libCocos2d",
"libDorothy",
"libBox2D",
"libLua",
"libCocosDenshion",
}
includedirs {
"project/Classes",
unpack(lua_inc),
}
is_build_to "windows"
kind "WindowedApp"
flags { "WinMain" }
files { "project/proj.win32/**.cpp", "project/proj.win32/**.rc",}
libdirs { "lua/lib/win32", "cocos2dx/platform/third_party/win32/libraries" }
local function T(d) return path.translate(path.join(os.getcwd(), d), "\\") end
prelinkcommands {
'xcopy /Y /Q ' .. T("cocos2dx\\platform\\third_party\\win32\\libraries\\*.dll") .. ' "$(OutDir)"',
'xcopy /Y /Q ' .. T("external\\sqlite3\\libraries\\win32\\*.*") .. ' "$(OutDir)"',
}
links {
"opengl32",
"ws2_32",
"wsock32",
-- sound.
"Strmiids",
"winmm",
"Ole32",
"dsound",
"lua51",
"libcurl_imp",
"libiconv",
"pthreadVCE2",
"glew32",
"libzlib",
}
is_build_to "android"
kind "SharedLib"
files { "project/proj.android/**.cpp",}
if _ACTION == "clean" then
os.rmdir("bin")
os.rmdir("build")
end
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。