diff options
author | Nathan Letwory <nathan@letworyinteractive.com> | 2004-03-05 18:20:52 +0300 |
---|---|---|
committer | Nathan Letwory <nathan@letworyinteractive.com> | 2004-03-05 18:20:52 +0300 |
commit | 9076b80db66e487e750d4bf0005f78f6f2c420b0 (patch) | |
tree | 3ab6ce98e1a4877e849d709e16407eff6b6a58a0 /SConstruct | |
parent | 811e144c6f25ec299340f881c0e33108c7576d20 (diff) |
* [SCons] enable BUILD_DATE for win32. Basically SCons creates an extra file in source/creator, which is included by buildinfo.c whenever BUILD_DATE is on and building on Windows. SCons automatically takes care of this dependency.
Diffstat (limited to 'SConstruct')
-rw-r--r-- | SConstruct | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/SConstruct b/SConstruct index 305c8524235..4ba418bf89d 100644 --- a/SConstruct +++ b/SConstruct @@ -943,7 +943,16 @@ if user_options_dict['BUILD_BLENDER_DYNAMIC'] == 1: dy_blender.Append (LIBPATH=user_options_dict['OPENGL_LIBPATH']) dy_blender.Append (CPPPATH=user_options_dict['OPENGL_INCLUDE']) if user_options_dict['USE_BUILDINFO'] == 1: - dy_blender.Append (CPPDEFINES = ['BUILD_TIME=\'"%s"\''%(build_time), + if sys.platform=='win32': + build_info_file = open("source/creator/winbuildinfo.h", 'w') + build_info_file.write("char *build_date=\"%s\";\n"%build_date) + build_info_file.write("char *build_time=\"%s\";\n"%build_time) + build_info_file.write("char *build_platform=\"win32\";\n") + build_info_file.write("char *build_type=\"dynamic\";\n") + build_info_file.close() + dy_blender.Append (CPPDEFINES = ['NAN_BUILDINFO', 'BUILD_DATE']) + else: + dy_blender.Append (CPPDEFINES = ['BUILD_TIME=\'"%s"\''%(build_time), 'BUILD_DATE=\'"%s"\''%(build_date), 'BUILD_TYPE=\'"dynamic"\'', 'NAN_BUILDINFO', @@ -962,7 +971,16 @@ if user_options_dict['BUILD_BLENDER_STATIC'] == 1: # libraries need to be at the end of the command. st_blender.Replace(LINKCOM="$LINK -o $TARGET $SOURCES $_LIBDIRFLAGS $_LIBFLAGS $LINKFLAGS") if user_options_dict['USE_BUILDINFO'] == 1: - st_blender.Append (CPPDEFINES = ['BUILD_TIME=\'"%s"\''%(build_time), + if sys.platform=='win32': + build_info_file = open("source/creator/winbuildinfo.h", 'w') + build_info_file.write("char *build_date=\"%s\";\n"%build_date) + build_info_file.write("char *build_time=\"%s\";\n"%build_time) + build_info_file.write("char *build_platform=\"win32\";\n") + build_info_file.write("char *build_type=\"static\";\n") + build_info_file.close() + st_blender.Append (CPPDEFINES = ['NAN_BUILDINFO', 'BUILD_DATE']) + else: + st_blender.Append (CPPDEFINES = ['BUILD_TIME=\'"%s"\''%(build_time), 'BUILD_DATE=\'"%s"\''%(build_date), 'BUILD_TYPE=\'"static"\'', 'NAN_BUILDINFO', |