summaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/builder.py19
1 files changed, 16 insertions, 3 deletions
diff --git a/python/builder.py b/python/builder.py
index ddca795..cfdb7d1 100644
--- a/python/builder.py
+++ b/python/builder.py
@@ -41,9 +41,22 @@ try:
usecuda=True
except KeyError:
pass
-cfg = open('astra/config.pxi','w')
-cfg.write('DEF HAVE_CUDA=' + str(usecuda) + "\n")
-cfg.close()
+
+cfgToWrite = 'DEF HAVE_CUDA=' + str(usecuda) + "\n"
+cfgHasToBeUpdated = True
+try:
+ cfg = open('astra/config.pxi','r')
+ cfgIn = cfg.read()
+ cfg.close()
+ if cfgIn==cfgToWrite:
+ cfgHasToBeUpdated = False
+except IOError:
+ pass
+
+if cfgHasToBeUpdated:
+ cfg = open('astra/config.pxi','w')
+ cfg.write(cfgToWrite)
+ cfg.close()
cmdclass = { }
ext_modules = [ ]