# BuildFox ninja generator

from lib_util import which

def discover():
	vars = {
		"variation": "debug"
	}

	if which("cl") and which("link") and which("lib"):
		vars["toolset_msvc"] = "true"

	if which("clang"):
		vars["toolset_clang"] = "true"

	if which("gcc") and which("g++"):
		vars["toolset_gcc"] = "true"

	if not which("ninja"):
		print("Warning ! Can't find ninja executable")

	if vars.get("toolset_msvc"):
		vars["toolset"] = "msvc"
	elif vars.get("toolset_clang"):
		vars["toolset"] = "clang"
	elif vars.get("toolset_gcc"):
		vars["toolset"] = "gcc"
	else:
		raise ValueError("Can't find any compiler")

	return vars

@@ -21,16 +21,42 @@
 erator%0A%0A
+import os%0Aimport platform%0A
 from lib
@@ -338,82 +338,8 @@
 e%22%0A%0A
-%09if not which(%22ninja%22):%0A%09%09print(%22Warning ! Can't find ninja executable%22)%0A%0A
 %09if 
@@ -516,16 +516,16 @@
 %0A%09else:%0A
-
 %09%09raise 
@@ -563,16 +563,211 @@
 iler%22)%0A%0A
+%09if not which(%22ninja%22):%0A%09%09print(%22Warning ! Can't find ninja executable%22)%0A%0A%09vars%5B%22system%22%5D = platform.system()%0A%09vars%5B%22machine%22%5D = platform.machine()%0A%09vars%5B%22cwd%22%5D = os.getcwd().replace(%22%5C%5C%22, %22/%22)%0A%0A
 %09return 

add more stuff to environment discovery