Premake 生成 Makefile 的缺省配置

来源:互联网 发布:阿里云工商数据查询 编辑:程序博客网 时间:2024/05/17 08:22
Premake 生成 Makefile 的缺省配置

(金庆的专栏 2017.7)

premake5.exe --os=linux gmake

生成的 Makefile 中有个 config, 用 make 生成release版本时使用以下命令:

make config=release_x64

在premake5.lua中可以如下设置,使config缺省为 release_x64:

workspace "AppWorkspace"
    configurations { "Release", "Debug" }
    platforms { "x64", "x32" }
    ...

即缺省配置为 configurations 和 platforms 的首个选项。

生成的 Makefile 中会如下初始化 config:

ifndef config
  config=release_x64
endif

这样 make 就会缺省生成 release_x64。


原创粉丝点击