Commits

Virgil Dupras committed e6cf8d5

Tweaked build script's compile/link flags (they were broken) and only build the framework if it's needed.

Comments (0)

Files changed (1)

     # Probably in the parent folder
     sys.path.insert(0, '..')
 from hscommon.build import OSXFrameworkStructure
+from hscommon.util import modified_after
 
 # Make sure to set CFLAGS and LDFLAGS (to have correct archs and isysroot) first.
 
     conf.load('compiler_c')
     conf.env.FRAMEWORK_COCOA = 'Cocoa'
     # Have the save compile/link flags as our python installation.
-    conf.env.append_value('CFLAGS', sysconfig.get_config_var('CFLAGS'))
-    conf.env.append_value('LDFLAGS', sysconfig.get_config_var('LDFLAGS'))
+    conf.env.append_value('CFLAGS', sysconfig.get_config_var('CFLAGS').split(' '))
+    conf.env.append_value('LINKFLAGS', sysconfig.get_config_var('LDFLAGS').split(' '))
     conf.env.append_value('LINKFLAGS', ['-install_name', '@rpath/PSMTabBarControl.framework/PSMTabBarControl'])
 
 def build(ctx):
 
 def build_framework(ctx):
     fmk = OSXFrameworkStructure('PSMTabBarControl.framework')
+    if not modified_after('build/PSMTabBarControl', fmk.executablepath):
+        print("No need to build the PSMTabBarControl framework, it's up-to-date.")
+        return
     fmk.create('Info.plist')
     fmk.copy_executable('build/PSMTabBarControl')
     fmk.copy_headers(*glob.glob('*.h'))