Lua53 premake

Lua53 premake

(金庆的专栏 2017.2)

参考:用premake5创建lua532工程
      http://blog.csdn.net/jq0123/article/details/51242780

-- premake5.lua
--[[
Usage examples:
   for windows: premake5.exe --os=windows vs2015
   fot linux:   premake5.exe --os=linux gmake
]]

workspace "lua53"
   configurations { "Debug", "Release" }
   targetdir "bin/%{cfg.buildcfg}"

   language "C++"
   -- Force VS to compile as C++.
   -- https://github.com/premake/premake-core/issues/142
   filter "action:vs*"
      buildoptions "/TP"

   filter "system:windows"
      defines { "LUA_BUILD_AS_DLL" }

   filter "configurations:Debug"
      defines { "DEBUG" }
      flags { "Symbols" }

   filter "configurations:Release"
      defines { "NDEBUG" }
      optimize "On"

project "lua53"
   kind "ConsoleApp"
   files { "src/lua.c" }
   links { "lua53_shared_lib" }   

project "luac53"
   kind "ConsoleApp"
   files { "src/luac.c" }
   links { "lua53_static_lib" }  -- Link error on Windows if link lua53 shared lib.   

project "lua53_shared_lib"
   kind "SharedLib"
   targetname "lua53"
   files { "src/*.h", "src/*.c" }
   removefiles { "src/lua.c", "src/luac.c" }

project "lua53_static_lib"
   kind "StaticLib"
   targetname "lua53"
   filter "system:windows"

      targetprefix "lib"  -- liblua53.lib

   filter {}

   files { "src/*.h", "src/*.c" }
   removefiles { "src/lua.c", "src/luac.c" }
      

更改之处:
* VS强制按C++编译
* 创建动态库和静态库
* lua53.exe 链接动态库,luac53.exe 链接静态库,
  因为 luac53.exe 链接动态库缺3个函数未导出。
* 添加宏 LUA_BUILD_AS_DLL,不然 lua53.dll 不会生成 lua53.lib   


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值