aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Frydrych <[email protected]>2017-04-04 15:03:35 +0200
committerTomasz Frydrych <[email protected]>2017-04-04 15:03:35 +0200
commit4a116c18630f046e02ff42664e67960b9defbc67 (patch)
tree5dfa295360a26e78ad21929966920e5fb92d0a90
parent667236d65e40203842acc5b9eb30c48b9c511bf3 (diff)
fix style
-rwxr-xr-xconfigure.py63
1 files changed, 32 insertions, 31 deletions
diff --git a/configure.py b/configure.py
index 87499e98a..6ec2abbae 100755
--- a/configure.py
+++ b/configure.py
@@ -1433,7 +1433,7 @@ def gen_bakefile(build_config, options, external_libs):
f.close()
-def gen_cmake(build_config, using_mods, cc, options):
+def gen_cmake(build_paths, using_mods, cc, options):
def create_target_rules(sources):
target = {'sources': {}, 'frameworks': set(), 'libs': set()}
for source in sources:
@@ -1454,25 +1454,24 @@ def gen_cmake(build_config, using_mods, cc, options):
target['libs'].add(lib)
if options.os in using_mod.frameworks:
for framework in using_mod.frameworks[options.os]:
- target['frameworks'].add('"-framework '+framework+'"')
+ target['frameworks'].add('"-framework %"' % framework)
- def generate_target_sources_list(fd, targetName, target):
- fd.write('set(' + targetName + '\n')
+ def generate_target_sources_list(fd, target_name, target):
+ fd.write('set(%s\n' % target_name)
for source in target['sources']:
- fd.write(' ${CMAKE_CURRENT_LIST_DIR}' + os.sep + os.path.normpath(source) + '\n')
+ fd.write(' ${CMAKE_CURRENT_LIST_DIR}%s%s\n' % (os.sep, os.path.normpath(source)))
fd.write(')\n\n')
def generate_target_source_files_isa_properties(fd, target):
for source in target['sources']:
- joinedIsaFlags = ' '.join(target['sources'][source]['isa_flags'])
- if joinedIsaFlags:
- fd.write('set_source_files_properties(${CMAKE_CURRENT_LIST_DIR}' +
- os.sep + os.path.normpath(source) +
- ' PROPERTIES COMPILE_FLAGS '+ joinedIsaFlags + ')\n')
+ joined_isa_flags = ' '.join(target['sources'][source]['isa_flags'])
+ if joined_isa_flags:
+ fd.write('set_source_files_properties(${CMAKE_CURRENT_LIST_DIR}%s%s PROPERTIES COMPILE_FLAGS %s)\n'
+ % (os.sep, os.path.normpath(source), joined_isa_flags))
- library_target_configuration = create_target_rules(build_config.lib_sources)
- tests_target_configuration = create_target_rules(build_config.test_sources)
- cli_target_configuration = create_target_rules(build_config.cli_sources)
+ library_target_configuration = create_target_rules(build_paths.lib_sources)
+ tests_target_configuration = create_target_rules(build_paths.test_sources)
+ cli_target_configuration = create_target_rules(build_paths.cli_sources)
for module in using_mods:
add_target_details(library_target_configuration, module)
@@ -1497,8 +1496,8 @@ def gen_cmake(build_config, using_mods, cc, options):
f.write('option(ENABLED_OPTIONAL_WARINIGS "If enabled more strict warinig policy will be used" OFF)\n')
f.write('option(ENABLED_LTO "If enabled link time optimization will be used" OFF)\n\n')
- f.write('set(COMPILER_FEATURES ' + cc.cc_compile_flags(options) + ' ' + cc.mach_abi_link_flags(options) + ')\n')
- f.write('set(COMPILER_WARNINGS ' + cc.cc_warning_flags(options) + ')\n')
+ f.write('set(COMPILER_FEATURES %s %s)\n' % (cc.cc_compile_flags(options), cc.mach_abi_link_flags(options)))
+ f.write('set(COMPILER_WARNINGS %s)\n' % cc.cc_warning_flags(options))
f.write('set(COMPILER_INCLUDE_DIRS build/include build/include/external)\n')
f.write('if(ENABLED_LTO)\n')
f.write(' set(COMPILER_FEATURES ${COMPILER_FEATURES} -lto)\n')
@@ -1508,41 +1507,43 @@ def gen_cmake(build_config, using_mods, cc, options):
' -Wnon-virtual-dtor -Wunused-macros -Wold-style-cast -Wuninitialized)\n')
f.write('endif()\n\n')
- library_target_libs_and_frameworks = (' '.join(library_target_configuration['frameworks']) + ' ' +
- ' '.join(library_target_configuration['libs']) + ' ' +
- cc.mach_abi_link_flags(options))
- tests_target_libs_and_frameworks = (' '.join(tests_target_configuration['frameworks']) + ' ' +
- ' '.join(tests_target_configuration['libs']))
- cli_target_libs_and_frameworks = (' '.join(cli_target_configuration['frameworks']) + ' ' +
- ' '.join(cli_target_configuration['libs']))
+ library_target_libs_and_frameworks = ('%s %s %s' % (' '.join(library_target_configuration['frameworks']),
+ ' '.join(library_target_configuration['libs']),
+ cc.mach_abi_link_flags(options)))
+ tests_target_libs_and_frameworks = ('%s %s' % (' '.join(tests_target_configuration['frameworks']),
+ ' '.join(tests_target_configuration['libs'])))
+ cli_target_libs_and_frameworks = ('%s %s' % (' '.join(cli_target_configuration['frameworks']),
+ ' '.join(cli_target_configuration['libs'])))
f.write('add_library(${PROJECT_NAME} STATIC ${BOTAN_SOURCES})\n')
- f.write('target_link_libraries(${PROJECT_NAME} PUBLIC ' + library_target_libs_and_frameworks + ')\n')
+ f.write('target_link_libraries(${PROJECT_NAME} PUBLIC %s)\n'
+ % library_target_libs_and_frameworks)
f.write('target_compile_options(${PROJECT_NAME} PUBLIC ' +
'${COMPILER_WARNINGS} ${COMPILER_FEATURES} ${COMPILER_OPTIONAL_WARNINGS})\n')
f.write('target_include_directories(${PROJECT_NAME} PUBLIC ${COMPILER_INCLUDE_DIRS})\n\n')
f.write('add_library(${PROJECT_NAME}_shared SHARED ${BOTAN_SOURCES})\n')
- f.write('target_link_libraries(${PROJECT_NAME}_shared PUBLIC ' + library_target_libs_and_frameworks + ')\n')
+ f.write('target_link_libraries(${PROJECT_NAME}_shared PUBLIC %s)\n'
+ % library_target_libs_and_frameworks)
f.write('target_compile_options(${PROJECT_NAME}_shared PUBLIC ' +
'${COMPILER_WARNINGS} ${COMPILER_FEATURES} ${COMPILER_OPTIONAL_WARNINGS})\n')
f.write('target_include_directories(${PROJECT_NAME}_shared PUBLIC ${COMPILER_INCLUDE_DIRS})\n')
f.write('set_target_properties(${PROJECT_NAME}_shared PROPERTIES OUTPUT_NAME ${PROJECT_NAME})\n\n')
f.write('add_executable(${PROJECT_NAME}_cli ${BOTAN_CLI})\n')
- f.write('target_link_libraries(${PROJECT_NAME}_cli PRIVATE ${PROJECT_NAME}_shared ' +
- cli_target_libs_and_frameworks + ')\n')
+ f.write('target_link_libraries(${PROJECT_NAME}_cli PRIVATE ${PROJECT_NAME}_shared %s)\n'
+ % cli_target_libs_and_frameworks)
f.write('set_target_properties(${PROJECT_NAME}_cli PROPERTIES OUTPUT_NAME ${PROJECT_NAME})\n\n')
f.write('add_executable(${PROJECT_NAME}_tests ${BOTAN_TESTS})\n')
- f.write('target_link_libraries(${PROJECT_NAME}_tests PRIVATE ${PROJECT_NAME}_shared ' +
- tests_target_libs_and_frameworks + ')\n')
+ f.write('target_link_libraries(${PROJECT_NAME}_tests PRIVATE ${PROJECT_NAME}_shared %s)\n'
+ % tests_target_libs_and_frameworks)
f.write('set_target_properties(${PROJECT_NAME}_tests PROPERTIES OUTPUT_NAME botan-test)\n\n')
f.write('set(CONFIGURATION_FILES configure.py .gitignore .astylerc authors.txt news.rst readme.rst)\n')
- f.write('file(GLOB_RECURSE DOCUMENTATION_FILES doc' + os.sep + '* )\n')
- f.write('file(GLOB_RECURSE HEADER_FILES src' + os.sep + '*.h )\n')
- f.write('file(GLOB_RECURSE INFO_FILES src' + os.sep + 'lib' + os.sep + '*info.txt )\n')
+ f.write('file(GLOB_RECURSE DOCUMENTATION_FILES doc%s* )\n' % os.sep)
+ f.write('file(GLOB_RECURSE HEADER_FILES src%s*.h )\n' % os.sep)
+ f.write('file(GLOB_RECURSE INFO_FILES src%slib%s*info.txt )\n' % (os.sep, os.sep))
f.write('add_custom_target(CONFIGURATION_DUMMY SOURCES ' +
'${CONFIGURATION_FILES} ${DOCUMENTATION_FILES} ${INFO_FILES} ${HEADER_FILES})\n')
f.close()