mibuild/xilinx/ise: fix source and set source to False by default on Windows (tools...
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Thu, 18 Jun 2015 22:52:39 +0000 (00:52 +0200)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Thu, 18 Jun 2015 22:52:39 +0000 (00:52 +0200)
mibuild/xilinx/ise.py

index 784d33fcf31a6dcf1931b0ce7c5099370e1263e4..6edd3dc2ae2277c4c52043540b724e2705384f8f 100644 (file)
@@ -107,9 +107,9 @@ def _run_ise(build_name, ise_path, source, mode, ngdbuild_opt,
         script_ext = ".sh"
         shell = ["bash"]
         build_script_contents = "# Autogenerated by mibuild\nset -e\n"
-
-    settings = common.settings(ise_path, ver, "ISE_DS")
-    build_script_contents += source_cmd + settings + "\n"
+    if source:
+        settings = common.settings(ise_path, ver, "ISE_DS")
+        build_script_contents += source_cmd + settings + "\n"
     if mode == "edif":
         ext = "edif"
     else:
@@ -145,6 +145,10 @@ def _default_ise_path():
         return "/opt/Xilinx"
 
 
+def _default_source():
+    return False if sys.platform == "win32" else True
+
+
 class XilinxISEToolchain:
     def __init__(self):
         self.xst_opt = """-ifmt MIXED
@@ -158,7 +162,7 @@ class XilinxISEToolchain:
         self.ise_commands = ""
 
     def build(self, platform, fragment, build_dir="build", build_name="top",
-            ise_path=_default_ise_path(), source=True, run=True, mode="xst"):
+            ise_path=_default_ise_path(), source=_default_source(), run=True, mode="xst"):
         tools.mkdir_noerror(build_dir)
         os.chdir(build_dir)