* Enable compile and link flags to build info also on Windows and in SCons.

* Added build_system SCons or CMake
* Write the new build info also to system-info.txt
This commit is contained in:
Nathan Letwory
2010-10-19 05:00:36 +00:00
parent 42d4e93733
commit 2a89fb887e
6 changed files with 33 additions and 5 deletions

View File

@@ -295,8 +295,14 @@ def buildinfo(lenv, build_type):
build_rev = '-UNKNOWN-' build_rev = '-UNKNOWN-'
if lenv['BF_DEBUG']: if lenv['BF_DEBUG']:
build_type = "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: else:
build_type = "Release" 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 = [] obj = []
if lenv['BF_BUILDINFO']: if lenv['BF_BUILDINFO']:
@@ -305,7 +311,12 @@ def buildinfo(lenv, build_type):
'BUILD_TYPE="%s"'%(build_type), 'BUILD_TYPE="%s"'%(build_type),
'BUILD_REV="%s"'%(build_rev), 'BUILD_REV="%s"'%(build_rev),
'NAN_BUILDINFO', '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']) lenv.Append (CPPPATH = [root_build_dir+'source/blender/blenkernel'])

View 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('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('build date: {}, {}\n'.format(bpy.app.build_date, bpy.app.build_time))
output.write('platform: {}\n'.format(bpy.app.build_platform)) 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 # python info
output.write('\nPython:\n') output.write('\nPython:\n')

View File

@@ -42,6 +42,7 @@ extern char build_type[];
extern char build_cflags[]; extern char build_cflags[];
extern char build_cxxflags[]; extern char build_cxxflags[];
extern char build_linkflags[]; extern char build_linkflags[];
extern char build_system[];
#endif #endif
static PyTypeObject BlenderAppType; static PyTypeObject BlenderAppType;
@@ -61,6 +62,7 @@ static PyStructSequence_Field app_info_fields[] = {
{"build_cflags", ""}, {"build_cflags", ""},
{"build_cxxflags", ""}, {"build_cxxflags", ""},
{"build_linkflags", ""}, {"build_linkflags", ""},
{"build_system", ""},
{0} {0}
}; };
@@ -105,6 +107,7 @@ static PyObject *make_app_info(void)
SetStrItem(build_cflags); SetStrItem(build_cflags);
SetStrItem(build_cxxflags); SetStrItem(build_cxxflags);
SetStrItem(build_linkflags); SetStrItem(build_linkflags);
SetStrItem(build_system);
#else #else
SetStrItem("Unknown"); SetStrItem("Unknown");
SetStrItem("Unknown"); SetStrItem("Unknown");
@@ -114,6 +117,7 @@ static PyObject *make_app_info(void)
SetStrItem("Unknown"); SetStrItem("Unknown");
SetStrItem("Unknown"); SetStrItem("Unknown");
SetStrItem("Unknown"); SetStrItem("Unknown");
SetStrItem("Unknown");
#endif #endif
#undef SetIntItem #undef SetIntItem

View File

@@ -95,15 +95,19 @@ IF(WIN32)
ENDIF(WIN32) ENDIF(WIN32)
IF(WITH_BUILDINFO) 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( ADD_DEFINITIONS(
-DBUILD_DATE="${BUILD_DATE}" -DBUILD_DATE="${BUILD_DATE}"
-DBUILD_TIME="${BUILD_TIME}" -DBUILD_TIME="${BUILD_TIME}"
-DBUILD_REV="${BUILD_REV}" -DBUILD_REV="${BUILD_REV}"
-DBUILD_PLATFORM="${CMAKE_SYSTEM_NAME}" -DBUILD_PLATFORM="${CMAKE_SYSTEM_NAME}"
-DBUILD_TYPE="${CMAKE_BUILD_TYPE}" -DBUILD_TYPE="${CMAKE_BUILD_TYPE}"
-DBUILD_CFLAGS="${CMAKE_C_FLAGS}" -DBUILD_CFLAGS="${BUILDINFO_CFLAGS}"
-DBUILD_CXXFLAGS="${CMAKE_CXX_FLAGS}" -DBUILD_CXXFLAGS="${BUILDINFO_CXXFLAGS}"
-DBUILD_LINKFLAGS="${PLATFORM_LINKFLAGS}" -DBUILD_LINKFLAGS="${BUILDINFO_LINKFLAGS}"
-DBUILD_SYSTEM="CMake"
) )
LIST(APPEND EXESRC buildinfo.c) LIST(APPEND EXESRC buildinfo.c)

View File

@@ -40,10 +40,12 @@ char build_type[]= STRINGIFY(BUILD_TYPE);
char build_cflags[]= STRINGIFY(BUILD_CFLAGS); char build_cflags[]= STRINGIFY(BUILD_CFLAGS);
char build_cxxflags[]= STRINGIFY(BUILD_CXXFLAGS); char build_cxxflags[]= STRINGIFY(BUILD_CXXFLAGS);
char build_linkflags[]= STRINGIFY(BUILD_LINKFLAGS); char build_linkflags[]= STRINGIFY(BUILD_LINKFLAGS);
char build_system[]= STRINGIFY(BUILD_SYSTEM);
#else #else
char build_cflags[]= "unmaintained buildsystem alert!"; char build_cflags[]= "unmaintained buildsystem alert!";
char build_cxxflags[]= "unmaintained buildsystem alert!"; char build_cxxflags[]= "unmaintained buildsystem alert!";
char build_linkflags[]= "unmaintained buildsystem alert!"; char build_linkflags[]= "unmaintained buildsystem alert!";
char build_system[]= "unmaintained buildsystem alert!";
#endif #endif
#endif // BUILD_DATE #endif // BUILD_DATE

View File

@@ -121,6 +121,7 @@ extern char build_type[];
extern char build_cflags[]; extern char build_cflags[];
extern char build_cxxflags[]; extern char build_cxxflags[];
extern char build_linkflags[]; extern char build_linkflags[];
extern char build_system[];
#endif #endif
/* Local Function prototypes */ /* 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_cflags);
printf ("\tbuild c++ flags: %s\n", build_cxxflags); printf ("\tbuild c++ flags: %s\n", build_cxxflags);
printf ("\tbuild link flags: %s\n", build_linkflags); printf ("\tbuild link flags: %s\n", build_linkflags);
printf ("\tbuild system: %s\n", build_system);
#endif #endif
exit(0); exit(0);
@@ -1054,6 +1056,7 @@ int main(int argc, char **argv)
strip_quotes(build_cflags); strip_quotes(build_cflags);
strip_quotes(build_cxxflags); strip_quotes(build_cxxflags);
strip_quotes(build_linkflags); strip_quotes(build_linkflags);
strip_quotes(build_system);
#endif #endif
BLI_threadapi_init(); BLI_threadapi_init();