为Windows创建一个rockspec。

我有点困惑 LuaRocks 文档。我正在创建一个 rockspec,它将复制库 dll 文件到 clibs,以及将一个文件添加到 lua/logging 文件夹中。这是我目前的代码

version = "1.0-1"
source = {
    url = "",
}
description = {
   summary = "An example for the LuaRocks tutorial.",
   detailed = [[
      This is an example for the LuaRocks tutorial.
      Here we would put a detailed, typically
      paragraph-long description.
   ]],
   homepage = "http://...", -- We don't have one yet
   license = "MIT/X11" -- or whatever you like
}
dependencies = {
   "lua ~> 5.1"
   -- If you depend on other rocks, add them here
}
build = {
  type = "make",
  install_variables = {
    LUA_LIBDIR = "$(LIBDIR)",
    LUA_DIR = "$(LUADIR)",
    BIN_DIR = "$(BINDIR)"
  },
  platforms = {
    win32 = {
      type = "make",
      build_variables = {
        LUA_DIR = "$(LUA_LIBDIR)\\lib/lib.dll",
      }
    }
  }
}

这样做正确吗?

我的配置文件为

rocks_servers = {
   [[http://luarocks.org/repositories/rocks]]
}
rocks_trees = {
   { root = LFW_ROOT, rocks_dir = LFW_ROOT..[[\rocks]],
     bin_dir = LFW_ROOT, lua_dir = LFW_ROOT..[[\lua]],
     lib_dir = LFW_ROOT..[[\clibs]] }
}
variables.WRAPPER = LFW_ROOT..[[\rclauncher.obj]]

当我尝试运行它时,我会遇到以下错误

operable program or batch file.

Error: Build error: Failed building.

当我在 VS2013 命令行中运行它时,我会遇到以下错误

Stop.

Error: Build error: Failed building.

最后一个问题是,我应该使用 make 还是 buildin,它们之间有什么区别?

更新:我能够复制和构建 lua 模块,但我仍然无法安装 lib,它会显示:失败复制 FileName,以下是我的最终代码

version = "1.0-1"
source = {
    url = "",
    dir = "lib",
    dir = "logging"
}
description = {
   summary = "An example for the LuaRocks tutorial.",
   detailed = [[
      This is an example for the LuaRocks tutorial.
      Here we would put a detailed, typically
      paragraph-long description.
   ]],
   homepage = "http://...", -- We don't have one yet
   license = "MIT/X11" -- or whatever you like
}
dependencies = {
   "lua ~> 5.1",
   -- If you depend on other rocks, add them here
}

build = {
  type = "builtin",
  install_variables = {
    LUA_LIBDIR = "$(LIBDIR)",
    LUA_DIR = "$(LUADIR)",
    BIN_DIR = "$(BINDIR)"
  },
  platforms = {
    win32 = {
     type = "builtin",
      modules = {
      ["logging.windows"] = "windows.lua",
      },
      install = {
        lib = {
        winEvntLog ="lib/winEvntLog.dll",
        msgLog = "lib/msgLog.dll",
        },
      },
    }
  }
}
点赞