From fd5359488527363d7f1639197bb4597f2d3993f4 Mon Sep 17 00:00:00 2001
From: Brandano <brandano@users.sourceforge.net>
Date: Thu, 16 Mar 2006 14:47:56 +0000
Subject: [PATCH] I made some little update to the script to make sure the libs
 are built in the proper order, and I also commented out the niflyze build
 string since it resides in another folder

---
 SConstruct | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/SConstruct b/SConstruct
index 929d973d..99badebe 100644
--- a/SConstruct
+++ b/SConstruct
@@ -1,5 +1,6 @@
 import sys
 import os
+import time
 from distutils import sysconfig
 
 Help("""
@@ -41,11 +42,14 @@ You can get it from http://www.swig.org/"""
     Exit(1)
 
 # build niflib and python wrapper
-env.StaticLibrary('niflib', Split('niflib.cpp nif_math.cpp NIF_Blocks.cpp NIF_IO.cpp docsys_extract.cpp'), CPPPATH = '.', CPPFLAGS = cppflags)
-env.SharedLibrary('_niflib', 'pyniflib.i', LIBS=['niflib'] + python_lib, LIBPATH=['.'] + python_libpath, SWIGFLAGS = '-c++ -python', CPPPATH = ['.'] + python_include, CPPFLAGS = cppflags, SHLIBPREFIX='')
+niflib = env.StaticLibrary('niflib', Split('niflib.cpp nif_math.cpp NIF_Blocks.cpp NIF_IO.cpp docsys_extract.cpp'), CPPPATH = '.', CPPFLAGS = cppflags)
+nifshlib = env.SharedLibrary('_niflib', 'pyniflib.i', LIBS=['niflib'] + python_lib, LIBPATH=['.'] + python_libpath, SWIGFLAGS = '-c++ -python', CPPPATH = ['.'] + python_include, CPPFLAGS = cppflags, SHLIBPREFIX='')
+# makes sure niflib.lib is built before trying to build _niflib.dll
+env.Depends(nifshlib, niflib)
+
 
 # Here's how to compile niflyze:
-env.Program('niflyze', 'niflyze.cpp', LIBS=['niflib'], LIBPATH=['.'], CPPFLAGS = cppflags)
+#env.Program('niflyze', 'niflyze.cpp', LIBS=['niflib'], LIBPATH=['.'], CPPFLAGS = cppflags)
 
 # A test program:
 #env.Program('test', 'test.cpp', LIBS=['niflib'], LIBPATH=['.'], CPPFLAGS = cppflags)
-- 
GitLab