我正在尝试使用premake4添加一个名为“虚拟”的动作。
这是我的premake4 lua脚本:
-- For reference, please refer to the premake wiki:
-- https://github.com/premake/premake-core/wiki
-- Demonstrates creating new actions:
-- dummy
--#!lua
-- A solution contains projects,
-- and defines the available configurations
solution "hello-world"
configurations { "Debug", "Release" }
-- A project defines one build target
project "hello-world"
kind "ConsoleApp"
language "C++"
files { "**.h", "**.cpp" }
configuration "Debug"
defines { "DEBUG" }
flags { "Symbols" }
configuration "Release"
defines { "NDEBUG" }
flags { "Optimize" }
premake.dummy = {}
-- Register the "runmakefile" action.
newaction
{
trigger = "dummy",
description = "dummy",
execute = function()
print("** dummy")
end
}
我已经生成了makefile,但是它不包含任何名为“ dummy”的动作。
我做错了什么,我该怎么办?
答案 0 :(得分:1)
newaction
向Premake添加一个动作,而不是生成的项目文件。您可以通过在命令提示符处运行以下命令来执行操作:
premake4 dummy
Premake4没有提供将自定义目标添加到生成的Makefile的方法。 Premake5提供了makesettings,可向生成文件中添加任意规则。