我是Premake的新手。我使用的是Premake 4.4 beta 5,因为Premake 5有几个问题,它不会生成正确的VS2010解决方案(使用2010编译器生成VS2012解决方案),并且在一个项目下编写所有项目时会设置libdirs和链接。在Premake中隐藏项目文件的常见父文件夹
无论如何,我遇到的问题是我写了一个Premake脚本。这一切都可以正常工作,但是它包含了项目中包含的所有文件之间共同的多个父文件夹的烦恼。所以你必须打开包含一个文件夹的多个文件夹,然后才能吃到肉。这里的是一个图像,让你明白:premake_common_parent_folders
上盘我的文件夹结构看起来是这样的:
- 构建
- premake4.lua
- premake4.4-β5 .exe
- SRC
- StaticLib
- 包括
- example.h文件
- Example.cpp
- 包括
- 测试
- Example.cpp
- StaticLib
这里是我的Premake:
_targetdir = '../bin/' .. _ACTION
local function ProjectCommon()
targetdir(_targetdir .. '/' .. project().name)
files {
'../src/' .. project().name .. '/**.*',
}
includedirs {
'../src/' .. project().name .. '/include',
}
end
solution('Example')
location(_ACTION)
configurations { "Release", "Debug" }
project('Test')
ProjectCommon()
language('C++')
kind('ConsoleApp')
includedirs {
'../src/StaticLib/include',
}
libdirs {
_targetdir .. '/StaticLib',
}
links {
solution().name,
}
project('StaticLib')
ProjectCommon()
targetname(solution().name)
language('C++')
kind('StaticLib')
我想知道是否有办法有直属的实现文件带有单个包含文件夹的项目。隐藏所有项目文件(src和[Project Name])之间通用的父文件夹。
的希望是有它看起来像这样:premake_no_common_parent_folders
这正是我所寻找的。非常感谢你! – RomanRobot