C++ 使用Premake5和#x27构建项目;不能生成可执行文件或中间文件
我最近看了一段视频,决定在我的项目中加入一个premake构建步骤。但是,在我的.lua文件中似乎实现了相同的代码(除了名称之外),premake不会生成bin和bin int目录。奇怪的是,.sln、.vcxproj和.vcxproj.filters文件都是生成的 我的premake5.lua文件:C++ 使用Premake5和#x27构建项目;不能生成可执行文件或中间文件,c++,lua,premake,C++,Lua,Premake,我最近看了一段视频,决定在我的项目中加入一个premake构建步骤。但是,在我的.lua文件中似乎实现了相同的代码(除了名称之外),premake不会生成bin和bin int目录。奇怪的是,.sln、.vcxproj和.vcxproj.filters文件都是生成的 我的premake5.lua文件: workspace "OpenGE" architecture "x64" startproject "Sandbox" configurations {
workspace "OpenGE"
architecture "x64"
startproject "Sandbox"
configurations
{
"Debug",
"Release",
"Dist"
}
outputdir = "%{cfg.buildcfg}-%{cfg.system}-%{cfg.architecture}"
project "OpenGE"
location "OpenGE"
kind "SharedLib"
language "C++"
targetdir ("bin/" .. outputdir .. "/%{prj.name}")
objdir ("bin-int/" .. outputdir .. "/%{prj.name}")
files
{
"%{prj.name}/src/**.h",
"%{prj.name}/src/**.cpp"
}
filter "system:windows"
cppdialect "C++17"
staticruntime "On"
systemversion "latest"
defines
{
"GE_DLL_BUILD"
}
postbuildcommands
{
"{COPY} %{cfg.buildtarget.relpath} ../bin/" .. outputdir .. "/Sandbox"
}
filter "configurations:Debug"
defines "GE_DEBUG"
runtime "Debug"
symbols "On"
filter "configurations:Release"
defines "GE_RELEASE"
runtime "Release"
optimize "On"
filter "configurations:Dist"
defines "GE_DIST"
runtime "Release"
optimize "On"
project "Sandbox"
location "Sandbox"
kind "ConsoleApp"
language "C++"
targetdir ("bin/" .. outputdir .. "/%{prj.name}")
objdir ("bin-int/" .. outputdir .. "/%{prj.name}")
files
{
"%{prj.name}/src/**.h",
"%{prj.name}/src/**.cpp"
}
includedirs
{
"OpenGE/src"
}
links
{
"OpenGE"
}
filter "system:windows"
cppdialect "C++17"
staticruntime "On"
systemversion "latest"
filter "configurations:Debug"
defines "GE_DEBUG"
runtime "Debug"
symbols "On"
filter "configurations:Release"
defines "GE_RELEASE"
runtime "Release"
optimize "On"
filter "configurations:Dist"
defines "GE_DIST"
runtime "Release"
optimize "On"
运行premake在命令行上的输出看起来很好:
C:\Users\bonnl\source\repos\OpenGE>call dependencies\premake\premake5 vs2019
Building configurations...
Running action 'vs2019'...
Done (92ms).
C:\Users\bonnl\source\repos\OpenGE>PAUSE
Press any key to continue . . .
如果需要任何其他代码或信息,我很乐意添加。事实证明,我认为premake将构建我的项目,并生成解决方案和项目文件。我已经建立了这个项目,它就像一个符咒一样工作“premake不会生成bin和bin int目录”。解决方案中的obj dir和target dir是否指向这些目录?在构建过程中创建目录是可视化的。作为剩余部分,premake不构建解决方案。真的吗?我想我是这样认为的,因为它被称为构建工具:)它创建独立的(与CMake相反)makefile/解决方案,您以后通常会使用它。是的,我在回顾时意识到了这一点。谢谢