* Enable compile and link flags to build info also on Windows and in SCons.
authorNathan Letwory <nathan@letworyinteractive.com>
Tue, 19 Oct 2010 05:00:36 +0000 (05:00 +0000)
committerNathan Letwory <nathan@letworyinteractive.com>
Tue, 19 Oct 2010 05:00:36 +0000 (05:00 +0000)
* Added build_system SCons or CMake
* Write the new build info also to system-info.txt

build_files/scons/tools/Blender.py
release/scripts/modules/sys_info.py
source/blender/python/intern/bpy_app.c
source/creator/CMakeLists.txt
source/creator/buildinfo.c
source/creator/creator.c

index 1f503a5ea2dba5a0641b6894182a360bdd4b511b..cab245a45181d7c9defbf9882041ff7f3d43149f 100644 (file)
@@ -295,8 +295,14 @@ def buildinfo(lenv, build_type):
         build_rev = '-UNKNOWN-'
     if lenv['BF_DEBUG']:
         build_type = "Debug"
+        build_cflags = ' '.join(lenv['CFLAGS'] + lenv['CCFLAGS'] + lenv['BF_DEBUG_CCFLAGS'] + lenv['CPPFLAGS'])
+        build_cxxflags = ' '.join(lenv['CCFLAGS'] + lenv['CXXFLAGS'] + lenv['CPPFLAGS'])
     else:
         build_type = "Release"
+        build_cflags = ' '.join(lenv['CFLAGS'] + lenv['CCFLAGS'] + lenv['REL_CFLAGS'] + lenv['REL_CCFLAGS'] + lenv['CPPFLAGS'])
+        build_cxxflags = ' '.join(lenv['CCFLAGS'] + lenv['CXXFLAGS'] + lenv['REL_CXXFLAGS'] + lenv['REL_CCFLAGS'] + lenv['CPPFLAGS'])
+
+    build_linkflags = ' '.join(lenv['PLATFORM_LINKFLAGS'])
 
     obj = []
     if lenv['BF_BUILDINFO']:
@@ -305,7 +311,12 @@ def buildinfo(lenv, build_type):
                                     'BUILD_TYPE="%s"'%(build_type),
                                     'BUILD_REV="%s"'%(build_rev),
                                     'NAN_BUILDINFO',
-                                    'BUILD_PLATFORM="%s:%s"'%(platform.system(), platform.architecture()[0])])
+                                    'BUILD_PLATFORM="%s:%s"'%(platform.system(), platform.architecture()[0]),
+                                    'BUILD_CFLAGS=\\"%s\\"'%(build_cflags),
+                                    'BUILD_CXXFLAGS=\\"%s\\"'%(build_cxxflags),
+                                    'BUILD_LINKFLAGS=\\"%s\\"'%(build_linkflags),
+                                    'BUILD_SYSTEM="SCons"'
+                    ])
 
         lenv.Append (CPPPATH = [root_build_dir+'source/blender/blenkernel'])
 
index b6f429141bfe48d2e92975f26212de65bdd895b6..58fb1aba377dd0e49ece8055d3388ce7c6043b2e 100644 (file)
@@ -68,7 +68,11 @@ def write_sysinfo(op):
        output.write('version {}, revision {}. {}\n'.format(bpy.app.version_string, bpy.app.build_revision, bpy.app.build_type))
        output.write('build date: {}, {}\n'.format(bpy.app.build_date, bpy.app.build_time))
        output.write('platform: {}\n'.format(bpy.app.build_platform))
-       output.write('binary path: {}\n\n'.format(bpy.app.binary_path))
+       output.write('binary path: {}\n'.format(bpy.app.binary_path))
+       output.write('build cflags: {}\n'.format(bpy.app.build_cflags))
+       output.write('build cxxflags: {}\n'.format(bpy.app.build_cxxflags))
+       output.write('build linkflags: {}\n'.format(bpy.app.build_linkflags))
+       output.write('build system: {}\n'.format(bpy.app.build_system))
 
        # python info
        output.write('\nPython:\n')
index 39494678a125fbdf753acfc054adbb422fe7d105..b7a277c76b0af62b48ee27b04ecec9a7c7eec8ed 100644 (file)
@@ -42,6 +42,7 @@ extern char build_type[];
 extern char build_cflags[];
 extern char build_cxxflags[];
 extern char build_linkflags[];
+extern char build_system[];
 #endif
 
 static PyTypeObject BlenderAppType;
@@ -61,6 +62,7 @@ static PyStructSequence_Field app_info_fields[] = {
        {"build_cflags", ""},
        {"build_cxxflags", ""},
        {"build_linkflags", ""},
+       {"build_system", ""},
        {0}
 };
 
@@ -105,6 +107,7 @@ static PyObject *make_app_info(void)
        SetStrItem(build_cflags);
        SetStrItem(build_cxxflags);
        SetStrItem(build_linkflags);
+       SetStrItem(build_system);
 #else
        SetStrItem("Unknown");
        SetStrItem("Unknown");
@@ -114,6 +117,7 @@ static PyObject *make_app_info(void)
        SetStrItem("Unknown");
        SetStrItem("Unknown");
        SetStrItem("Unknown");
+       SetStrItem("Unknown");
 #endif
 
 #undef SetIntItem
index 65099761fada5cce02db53ca15f3a1edbd1e872d..27640cbc185f033330103573f2215454f55b97f2 100644 (file)
@@ -95,15 +95,19 @@ IF(WIN32)
 ENDIF(WIN32)
 
 IF(WITH_BUILDINFO)
+       STRING(REPLACE " " "\ " BUILDINFO_CFLAGS ${CMAKE_C_FLAGS})
+       STRING(REPLACE " " "\ " BUILDINFO_CXXFLAGS ${CMAKE_CXX_FLAGS})
+       STRING(REPLACE " " "\ " BUILDINFO_LINKFLAGS ${PLATFORM_LINKFLAGS})
        ADD_DEFINITIONS(
                -DBUILD_DATE="${BUILD_DATE}"
                -DBUILD_TIME="${BUILD_TIME}"
                -DBUILD_REV="${BUILD_REV}"
                -DBUILD_PLATFORM="${CMAKE_SYSTEM_NAME}"
                -DBUILD_TYPE="${CMAKE_BUILD_TYPE}"
-               -DBUILD_CFLAGS="${CMAKE_C_FLAGS}"
-               -DBUILD_CXXFLAGS="${CMAKE_CXX_FLAGS}"
-               -DBUILD_LINKFLAGS="${PLATFORM_LINKFLAGS}"
+               -DBUILD_CFLAGS="${BUILDINFO_CFLAGS}"
+               -DBUILD_CXXFLAGS="${BUILDINFO_CXXFLAGS}"
+               -DBUILD_LINKFLAGS="${BUILDINFO_LINKFLAGS}"
+               -DBUILD_SYSTEM="CMake"
        )
 
        LIST(APPEND EXESRC buildinfo.c)
index cf6f5a11c45d94e98ed2829aa5f994c038140afc..2203a97aa9186c431e879829cdcb781dde870f6a 100644 (file)
@@ -40,10 +40,12 @@ char build_type[]= STRINGIFY(BUILD_TYPE);
 char build_cflags[]= STRINGIFY(BUILD_CFLAGS);
 char build_cxxflags[]= STRINGIFY(BUILD_CXXFLAGS);
 char build_linkflags[]= STRINGIFY(BUILD_LINKFLAGS);
+char build_system[]= STRINGIFY(BUILD_SYSTEM);
 #else
 char build_cflags[]= "unmaintained buildsystem alert!";
 char build_cxxflags[]= "unmaintained buildsystem alert!";
 char build_linkflags[]= "unmaintained buildsystem alert!";
+char build_system[]= "unmaintained buildsystem alert!";
 #endif
 
 #endif // BUILD_DATE
index 117efe6bba60498913e049a702e484dc7177d6a6..ed2f671a1616367e5da7314579a8bdaf038cf5f8 100644 (file)
@@ -121,6 +121,7 @@ extern char build_type[];
 extern char build_cflags[];
 extern char build_cxxflags[];
 extern char build_linkflags[];
+extern char build_system[];
 #endif
 
 /*     Local Function prototypes */
@@ -190,6 +191,7 @@ static int print_version(int UNUSED(argc), char **UNUSED(argv), void *UNUSED(dat
        printf ("\tbuild c flags: %s\n", build_cflags);
        printf ("\tbuild c++ flags: %s\n", build_cxxflags);
        printf ("\tbuild link flags: %s\n", build_linkflags);
+       printf ("\tbuild system: %s\n", build_system);
 #endif
        exit(0);
 
@@ -1054,6 +1056,7 @@ int main(int argc, char **argv)
        strip_quotes(build_cflags);
        strip_quotes(build_cxxflags);
        strip_quotes(build_linkflags);
+       strip_quotes(build_system);
 #endif
 
        BLI_threadapi_init();