premake5:如何在vs2015中将运行时库设置为多线程DLL(/MD)

sum*_*mer 5 c++ autocad premake visual-studio-2015

kind "SharedLib"
language "C++"
defines "DLL_EXPORT"
targetname "read_cad_file"
targetextension ".arx"
Run Code Online (Sandbox Code Playgroud)

我正在使用 objectARX 进行开发,我想使用premake5vs2015编译我的项目。脚本中的一些设置如上。在此设置下,在属性->C/C++->代码生成->运行时库中,运行时库为Multithreaded Debug(/MTd)。我想问如何使用premake5将其更改为多线程DLL(/MD)?多谢:)

Alb*_*bin 7

为了在 premake 中更改运行时库,您需要使用两个关键字 -staticruntimeruntime

要在预制作中使用 /MT:

staticruntime "on"
runtime "Release"
Run Code Online (Sandbox Code Playgroud)

要在预制作中使用 /MTd:

staticruntime "on"
runtime "Debug"
Run Code Online (Sandbox Code Playgroud)

要在预制中使用 /MD:

staticruntime "off"
runtime "Release"
Run Code Online (Sandbox Code Playgroud)

要在预制中使用 /MDd:

staticruntime "off"
runtime "Debug"
Run Code Online (Sandbox Code Playgroud)


Flo*_*och 0

我不知道运行时的静态版本或 DLL 版本。但调试和发布应该可以通过runtime关键字切换。看:

https://github.com/premake/premake-core/wiki/runtime