jimon / premake-ninja Goto Github PK
View Code? Open in Web Editor NEWPremake extension to support Ninja
License: MIT License
Premake extension to support Ninja
License: MIT License
Running tests for current HEAD (commit e51a1cb) and it fails. See full output below.
Among other things there are message like ninja: error: unknown target 'debug'
and ninja: warning: multiple rules generate ninjatestprj_lib.
[anatol@arch tests]$ python ./run_tests.py
-------------------------- test default setup
Building configurations...
Running action 'ninja'...
Generated build/build.ninja...
Generated build/build_ninjatestprj_debug.ninja...
Generated build/build_ninjatestprj_release.ninja...
Done (15ms).
ninja: Entering directory `build'
[4/4] link bin_debug/ninjatestprj
ninja: Entering directory `build'
ninja: error: unknown target 'debug'
FBuilding configurations...
Running action 'ninja'...
Generated build/build.ninja...
Generated build/build_ninjatestprj_debug.ninja...
Generated build/build_ninjatestprj_release.ninja...
Done (22ms).
ninja: Entering directory `build'
[5/5] link bin_debug/ninjatestprj
ninja: Entering directory `build'
ninja: error: unknown target 'debug'
FBuilding configurations...
Running action 'ninja'...
Generated build/build.ninja...
Generated build/build_ninjatestprj_debug.ninja...
Generated build/build_ninjatestprj_release.ninja...
Done (16ms).
ninja: Entering directory `build'
[2/2] link bin_release/libninjatestprj.so
FBuilding configurations...
Running action 'ninja'...
Generated build/build.ninja...
Generated build/build_ninjatestprj_app_debug.ninja...
Generated build/build_ninjatestprj_app_release.ninja...
Generated build/build_ninjatestprj_lib_test1_debug.ninja...
Generated build/build_ninjatestprj_lib_test1_release.ninja...
Generated build/build_ninjatestprj_lib_test2_debug.ninja...
Generated build/build_ninjatestprj_lib_test2_release.ninja...
Done (23ms).
ninja: Entering directory `build'
[6/6] link bin_debug/ninjatestprj_app
ninja: Entering directory `build'
ninja: error: unknown target 'debug'
FBuilding configurations...
Running action 'ninja'...
Generated build/build.ninja...
Generated build/build_ninjatestprj_debug.ninja...
Generated build/build_ninjatestprj_release.ninja...
Done (13ms).
ninja: Entering directory `build'
[2/2] ar bin_release/libninjatestprj.a
FBuilding configurations...
Running action 'ninja'...
Generated build/build.ninja...
Generated build/build_ninjatestprj_app_debug.ninja...
Generated build/build_ninjatestprj_app_release.ninja...
Generated build/build_ninjatestprj_lib test1_debug.ninja...
Generated build/build_ninjatestprj_lib test1_release.ninja...
Generated build/build_ninjatestprj_lib_test2_debug.ninja...
Generated build/build_ninjatestprj_lib_test2_release.ninja...
Done (20ms).
ninja: Entering directory `build'
ninja: warning: multiple rules generate ninjatestprj_lib. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
[6/6] link bin_debug/ninjatestprj_app
ninja: Entering directory `build'
ninja: warning: multiple rules generate ninjatestprj_lib. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: error: unknown target 'debug'
FBuilding configurations...
Running action 'ninja'...
Generated build/build.ninja...
Generated build/build_ninjatestprj_debug.ninja...
Generated build/build_ninjatestprj_release.ninja...
Done (14ms).
ninja: Entering directory `build'
[4/4] link bin_debug/ninjatestprj
ninja: Entering directory `build'
ninja: error: unknown target 'debug'
F
======================================================================
FAIL: test_include_path (__main__.TestConsoleApp)
----------------------------------------------------------------------
Traceback (most recent call last):
File "./run_tests.py", line 146, in test_include_path
self.check_basics("build/bin_debug/ninjatestprj", "build/bin_release/ninjatestprj")
File "./run_tests.py", line 122, in check_basics
self.ninja("debug")
File "./run_tests.py", line 51, in ninja
self.assertEqual(subprocess.call(args), 0, "looks like ninja failed")
AssertionError: 1 != 0 : looks like ninja failed
======================================================================
FAIL: test_simple (__main__.TestConsoleApp)
----------------------------------------------------------------------
Traceback (most recent call last):
File "./run_tests.py", line 140, in test_simple
self.check_basics("build/bin_debug/ninjatestprj", "build/bin_release/ninjatestprj")
File "./run_tests.py", line 122, in check_basics
self.ninja("debug")
File "./run_tests.py", line 51, in ninja
self.assertEqual(subprocess.call(args), 0, "looks like ninja failed")
AssertionError: 1 != 0 : looks like ninja failed
======================================================================
FAIL: test_simple (__main__.TestSharedLib)
----------------------------------------------------------------------
Traceback (most recent call last):
File "./run_tests.py", line 172, in test_simple
self.check_basics("build/bin_debug/ninjatestprj", "build/bin_release/ninjatestprj")
File "./run_tests.py", line 118, in check_basics
self.out_exist(out_debug)
File "./run_tests.py", line 74, in out_exist
os.path.exists(self.out_name(path, ".dylib", "lib"))
AssertionError: False is not true
======================================================================
FAIL: test_withapp (__main__.TestSharedLib)
----------------------------------------------------------------------
Traceback (most recent call last):
File "./run_tests.py", line 178, in test_withapp
self.check_basics("build/bin_debug/ninjatestprj_app", "build/bin_release/ninjatestprj_app")
File "./run_tests.py", line 122, in check_basics
self.ninja("debug")
File "./run_tests.py", line 51, in ninja
self.assertEqual(subprocess.call(args), 0, "looks like ninja failed")
AssertionError: 1 != 0 : looks like ninja failed
======================================================================
FAIL: test_simple (__main__.TestStaticLib)
----------------------------------------------------------------------
Traceback (most recent call last):
File "./run_tests.py", line 154, in test_simple
self.check_basics("build/bin_debug/ninjatestprj", "build/bin_release/ninjatestprj")
File "./run_tests.py", line 118, in check_basics
self.out_exist(out_debug)
File "./run_tests.py", line 74, in out_exist
os.path.exists(self.out_name(path, ".dylib", "lib"))
AssertionError: False is not true
======================================================================
FAIL: test_withapp (__main__.TestStaticLib)
----------------------------------------------------------------------
Traceback (most recent call last):
File "./run_tests.py", line 160, in test_withapp
self.check_basics("build/bin_debug/ninjatestprj_app", "build/bin_release/ninjatestprj_app")
File "./run_tests.py", line 122, in check_basics
self.ninja("debug")
File "./run_tests.py", line 51, in ninja
self.assertEqual(subprocess.call(args), 0, "looks like ninja failed")
AssertionError: 1 != 0 : looks like ninja failed
======================================================================
FAIL: test_simple (__main__.TestWindowedApp)
----------------------------------------------------------------------
Traceback (most recent call last):
File "./run_tests.py", line 190, in test_simple
self.check_basics("build/bin_debug/ninjatestprj", "build/bin_release/ninjatestprj")
File "./run_tests.py", line 122, in check_basics
self.ninja("debug")
File "./run_tests.py", line 51, in ninja
self.assertEqual(subprocess.call(args), 0, "looks like ninja failed")
AssertionError: 1 != 0 : looks like ninja failed
----------------------------------------------------------------------
Ran 7 tests in 0.651s
FAILED (failures=7)
I want to split my different projects up into their own independent premake files and then include them into the master premake file with the workspace established. It compiles perfectly fine in premake but the ninja build commands never actually build anything from the other project files. Is this not supported yet or am I doing something wrong?
To repro, add this to one of test projects:
architecture "x86_64"
platforms "x64"
Result:
Building configurations...
Running action 'ninja'...
Generated build/build.ninja...
Generated build/build_ninjatestprj_debug_x64.ninja...
Generated build/build_ninjatestprj_release_x64.ninja...
Done (40ms).
ninja: error: 'ninjatestprj_debug_x64' missing and no known rule to make it
The issue is that a file like build_ninjatestprj_release_x64.ninja
will be created, but in its line is build ninjatestprj_release
without _x64.
I think the _x64 should be included (cause x86 variant can exist), especially that architecture is often also reflected in the target path (such as x64/Release
) in build configs.
I'm making issue rather than PR as currently I'm not too sure how to fix it...
So premake/premake-core#141 is closed. Would be nice to actually commit this to upstream so it would be maintained more properly.
Honestly premake5's make action is not that complicated, so this one shouldn't be that hard either. Some topics to think about :
I've fixed both the above issues locally, but this project seems dead.
Is it still alive, but just moving very slowly?
Described here : https://github.com/premake/premake-core/wiki/toolset
I am completely new to premake (after giving up all hope over CMake) but this premake5.lua
file generates a make file with no questions asked. It spits out the error in title when used with ninja. Am I doing something wrong or is it wrong?
workspace "TBTED"
configurations { "Debug", "Release" }
kind "ConsoleApp"
language "C++"
targetdir "bin"
project "Converter"
targetdir "bin/converter"
files { "converter.cpp" }
filter "configurations:Debug"
defines { "_DEBUG_" }
(At the same time I will also ask on the side here if it's intentional for ninja to have a seperate file for each configuration (premake generates three files). Make only requires a single makefile, does Ninja require multiple? My bad, make does use multiple files.)
generating two "-include precompiled.h" args,
once in CFLAGS & CXXFLAGS
and once in rule cc/cxx's command
.
this causes compilation error:
clang-15: warning: precompiled header 'obj/precompiled.h.gch' was ignored because '-include obj/precompiled.h' is not first '-include'
clang-15: warning: argument unused during compilation: '-MD' [-Wunused-command-line-argument]
<built-in>:2:10: fatal error: 'obj/precompiled.h' file not found
removing -include obj/precompiled.h
from command
fixes this problem.
There's no support for assembling the .asm files with MASM (ml64.exe)
In some obscure case if you specify library like User32.lib then compiler will fail with error.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.