0

我是 Premake 的新手,但我已在 Windows 上的 Visual Studio 项目中成功使用它。现在,我有一个适用于 Visual Studio 和 Makefile 项目的 premake5 脚本,但 xcode 和 codelite 项目失败:

$ premake5 --verbose xcode4
Building configurations...
Running action 'xcode4'...
Error: [string "xcode/xcode_common.lua"]:201: bad argument #1 to 'pairs'
    (table expected, got nil)

XCode 和 CodeLite 支持被列为主要工作;谁能告诉我我在下面的预制清单中是否遇到了一些特定问题?解决方案非常简单。

我的主要 Premake 解决方案文件:src/premake5.lua

solution "LogicCore"

    -- set the major and minor build numbers
    VERSION_MAJOR = 1
    VERSION_MINOR = 0

    major = "VERSION_MAJOR=" .. VERSION_MAJOR; 
    minor = "VERSION_MINOR=" .. VERSION_MINOR; 

    defines { major, minor }

    configurations { "Debug", "Release" }

    configuration { "Debug" }
        targetdir "../bin/debug"

    configuration { "Release" }
        targetdir "../bin/release"

    if _ACTION == "clean" then
        os.rmdir("../bin")
    end

    -- PROJECT: Generic include and utility functions.
    include "lc"

我的 Premake 子项目文件:src/lc/premake5.lua

project "lc"
    kind "StaticLib"
    language "C"
    location "./"
    files { "**.h", "**.c" }

    configuration {"Debug"}
        targetsuffix "_d";
        defines { "DEBUG" };
        flags { "Symbols" };

    configuration {"Release"}
        defines { "NDEBUG" };
        flags { "Optimize" };

提前感谢您的帮助。

4

0 回答 0