Search code examples
c++stdvisual-studio-2022premake

Creating standard library modules with Premake


I am trying to create a premake script that creates a VS2022 project file that automatically creates C++23 standard library modules, i.e. where the option "Build ISO C++23 Standard Library Modules" is set.

I wanted to use vsprops for this. But no matter where I put the line

vsprops {BuildStlModules = "true"}

in the script, I always get the error “attempt to call a nil value (global ‘vsprops’)”. (Premake version 5.0beta2)

I've also tried

BuildStlModules = "On"

with the newest Version from Github. It does not generate an error, but has no effect either.

I would be grateful for any advice on what I am doing wrong.


Solution

  • I've found the solution. You have to use the latest version from Github (5.0 beta2 does not work). But the syntax is different from the one I tried above. With the line

    buildstlmodules "On"
    

    it works.