Closed Enhex closed 1 year ago
Warning about -MD
just fixed by https://github.com/jimon/premake-ninja/commit/50798a57a070b7dd9a0340ea88ca0202cb98a3c5
About pch, the test projects https://github.com/Jarod42/premake-sample-projects/tree/master/projects/project-03-pch passes successfully with ninja (both gcc/clang and even msvc :-) ).
According to https://premake.github.io/docs/Precompiled-Headers/#considerations-for-non-visual-studio-tools, no needs to add extra forceinclude
(which might be your issue).
Else, can you show your (simplified) premake5.lua? Would it compile fine with other generators?
looking at my code compared to these tests i use both pchheader
and forceincludes
:
pchheader "precompiled.h"
pchsource "src/precompiled.cpp"
forceincludes{ precompiled.h" }
if i recall correctly i did it few years ago because using only one of them will cause either GCC or MSVC to not work. I'll need to test it again and report back.
From what I can see from the tests,
forceinclude
),
and I don't have CI for premake4 with msvc, so, maybe similar issues (but as msvc is first citizen in premake, I doubt it was problematic). but premake4 is old anyway ;-)to narrow down the checking I got the error on Linux with premake5 and gmake2
Do you mean you need forceinclude with gmake2? My sample project works for all generators but xcode4.
For now, on my side, it seems more an issue with your script.
If you have one script which fails without the forceinclude
(even with another generators except on macos), I might investigate.
Closing. (Assuming error was in your script, and pch testing project works).
generating two "-include precompiled.h" args, once in CFLAGS & CXXFLAGS and once in rule cc/cxx's
command
.this causes compilation error:
removing
-include obj/precompiled.h
fromcommand
fixes this problem.