使用Premake5构建项目不会生成可执行文件或中间件

问题描述 投票:0回答:1

我最近观看了this视频,并决定在我的项目中包括一个预制制作步骤。但是,在看似完全在我的.lua文件中实现代码(除了名称之外)之后,premake不会生成bin和bin-int目录。奇怪的是,.sln,.vcxproj和.vcxproj.filters文件都已生成。

我的premake5.lua文件:

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 . . .

如果需要任何其他代码或信息,我很乐意添加。

c++ lua premake
1个回答
0
投票

原来,我认为premake可以构建我的项目以及生成解决方案和项目文件。从那以后我就建立了这个项目,它的工作就像一个魅力

© www.soinside.com 2019 - 2024. All rights reserved.