premake oddities / bugs...

112 views
Skip to first unread message

Tarmo Pikaro

unread,
Jan 24, 2017, 3:55:54 PM1/24/17
to Premake Development
Hi !

I'm continuing developing .vcxproj to .lua convertor, located at https://sourceforge.net/p/syncproj/code/HEAD/tree/ 

Now I'm able to build almost whole .lua script from .vcxproj files, but I suspect it's incomplete, so haven't yet tried to compile anything - trying to compare what .lua scripts produce versus
original project file.

So noticed following oddities:

1. includedirs ignores filter.

.lua configuration:

    filter  { "Debug", "platforms:Win32", "files:../bin/winvlc.c" }
        flags { "NoPch" }
        defines { "WIN32", "_DEBUG", "_WINDOWS", "HAVE_CONFIG_H" }
        includedirs { "..", "../include", "../util" }

Original project xml tags:

    <ClCompile Include="..\bin\winvlc.c">
      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">WIN32;_DEBUG;_WINDOWS;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..;../include;../util;</AdditionalIncludeDirectories>
      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
    </ClCompile>

Produced project xml tags:

    <ClCompile Include="..\bin\winvlc.c">
      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">WIN32;_DEBUG;_WINDOWS;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
    </ClCompile>

Like you probably notice include directories are missing. Bug ?

2. Precompiled header specification is ignored.

.lua configuration:

    filter  { "files:../src/modules/bank.c"  }
        flags { "NoPch" }
    filter  { "Debug", "platforms:Win32", "files:../src/modules/bank.c" }
        defines { "HAVE_DYNAMIC_PLUGINS" }

Original project xml tags:

    <ClCompile Include="..\src\modules\bank.c">
      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">HAVE_DYNAMIC_PLUGINS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
    </ClCompile>

Produced project xml tags:

    <ClCompile Include="..\src\modules\bank.c">
      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">HAVE_DYNAMIC_PLUGINS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
    </ClCompile>

PrecompiledHeader is missing ?


Btw , what I have tested - you cannot apply multiple filters at the time so filter { "Debug" } filter { "platforms:Win32" } resets current filter and starts new filter definition.

Let's start with these ones, I'll try to cherry pick more problems.

starkos

unread,
Jan 25, 2017, 11:37:37 AM1/25/17
to Premake Development
1. includedirs ignores filter.

Or, more likely, per-file support hasn't been added for that feature yet. I'm working on that problem currently. Try setting it for the whole project instead of just one file.

2. Precompiled header specification is ignored.

Same thing, most likely.

Btw , what I have tested - you cannot apply multiple filters at the time so filter { "Debug" } filter { "platforms:Win32" } resets current filter and starts new filter definition.

Yes, that is how Premake works. filter { "configurations:Debug", "platforms:Win32" } is the right syntax for filtering on both axes.

Tarmo Pikaro

unread,
Jan 25, 2017, 12:23:42 PM1/25/17
to Premake Development
> Or, more likely, per-file support hasn't been added for that feature yet. I'm working on that problem currently. Try setting it for the whole project instead of just one file.

Yes, I will - from my perspective it's bit stupid to set include directories per file. But you can find a lot of issues in projects. I'll try to set includedirs globally then.

2. Precompiled header specification is ignored.

> Same thing, most likely.

If includedirs is optional nice-to-have feature, but I suspect this is a mandatory. What I have also checked if you omit one configuration line - you get precompiled headers disabled.
So I suspect here is something to do with double configuring same file.

Reply all
Reply to author
Forward
0 new messages