source_library_length = 0;
- memcpy(source_library, data.path_build_libraries_static.string, data.path_build_libraries_static.used);
- source_library_length += data.path_build_libraries_static.used;
+ // only include the library if there are sources that would result in it being built.
+ if (data_build.setting.build_sources_library.used) {
+ memcpy(source_library, data.path_build_libraries_static.string, data.path_build_libraries_static.used);
+ source_library_length += data.path_build_libraries_static.used;
- memcpy(source_library + source_library_length, fake_build_parameter_library_name_prefix, fake_build_parameter_library_name_prefix_length);
- source_library_length += fake_build_parameter_library_name_prefix_length;
+ memcpy(source_library + source_library_length, fake_build_parameter_library_name_prefix, fake_build_parameter_library_name_prefix_length);
+ source_library_length += fake_build_parameter_library_name_prefix_length;
- memcpy(source_library + source_library_length, data_build.setting.project_name.string, data_build.setting.project_name.used);
- source_library_length += data_build.setting.project_name.used;
+ memcpy(source_library + source_library_length, data_build.setting.project_name.string, data_build.setting.project_name.used);
+ source_library_length += data_build.setting.project_name.used;
- memcpy(source_library + source_library_length, fake_build_parameter_library_name_suffix_static, fake_build_parameter_library_name_suffix_static_length);
- source_library_length += fake_build_parameter_library_name_suffix_static_length;
+ memcpy(source_library + source_library_length, fake_build_parameter_library_name_suffix_static, fake_build_parameter_library_name_suffix_static_length);
+ source_library_length += fake_build_parameter_library_name_suffix_static_length;
+ }
source_library[source_library_length] = 0;
# @fixme: this reveals some shortcomings and problems:
# 1) need to be able to build -m bzip2recover without libbzip2.a.
# 2) need to provide a way to designate path prefixes (instead of just hardcoded sources/c/, etc...
-# 3) need to be able to build shared program without library (add a 'build_library' setting).
project_name bzip2
build_language c
build_linker ar
build_libraries -lc
-build_sources_library blocksort.c huffman.c crctable.c randtable.c compress.c decompress.c bzlib.c
-build_sources_program bzip2.c
+build_sources_library
+build_sources_program blocksort.c huffman.c crctable.c randtable.c compress.c decompress.c bzlib.c bzip2.c
build_sources_headers bzlib.h
build_sources_script
build_sources_setting
# @fixme: this reveals some shortcomings and problems:
# 1) need to be able to build -m bzip2recover without libbzip2.a.
# 2) need to provide a way to designate path prefixes (instead of just hardcoded sources/c/, etc...
-# 3) need to be able to build shared program without library (add a 'build_library' setting).
project_name bzip2recover
process_pre
process_post
-modes
-modes_default
+modes
+modes_default
build_compiler gcc
build_language c