def gen_test(sol, solf, test_name, directory, proj_dir, name, c_file): # set up LIB build proj_name = vcx_name = test_name[2:] vcx_path = abspath(join(solution_dir, directory, name + '_' + vcx_name, vcx_name + '.vcxproj')) gen_filter(vcx_path + '.filters', solution_dir, [], [('', c_file)], [], '12.0') guid = sol.get_project_guid(vcx_name, vcx_path) mode = ('Win32', 'x64') inc_dirs = r'..\..\;..\..\..\;..\..\..\..\mpir\lib\$(IntDir);..\..\..\..\mpfr\lib\$(IntDir);..\..\..\;..\..\..\..\pthreads\lib\$(IntDir);' link_libs = r'..\..\..\lib\$(IntDir)lib_arb.lib;..\..\..\..\mpir\lib\$(IntDir)mpir.lib;..\..\..\..\mpfr\lib\$(IntDir)mpfr.lib;..\..\..\..\flint\lib\$(IntDir)lib_flint.lib;..\..\..\..\pthreads\lib\$(IntDir)pthreads.lib;' gen_vcxproj(vcx_path, arb_dir, test_name, guid, mode, Project_Type.APP, flib_type, False, False, False, [], [('', c_file)], inc_dirs, link_libs, vs_info) sol.add_project(solf, vcx_name, vcx_path, guid)
mp_dir = loc if loc else config break else: mp_dir = config cf = config.replace('\\', '_') # set up DLL build proj_name = 'mpir' vcx_name = 'dll_mpir_' + cf vcx_path = abspath(join(build_dir, vcx_name, vcx_name + '.vcxproj')) guid = solc.get_project_guid(vcx_name, vcx_path) gen_filter(vcx_path + '.filters', mpir_root_dir, hf_list, c_src_list + cc_src_list + mpn_f[1], af_list, 12.0) gen_vcxproj(vcx_path, mpir_root_dir, proj_name, guid, mp_dir, mode, Project_Type.DLL, False, hf_list, c_src_list + cc_src_list + mpn_f[1], af_list, add_prebuild, vs_info) solc.add_project('', vcx_name, vcx_path, guid) # set up LIB build proj_name = 'mpir' vcx_name = 'lib_mpir_' + cf vcx_path = abspath(join(build_dir, vcx_name, vcx_name + '.vcxproj')) guid = solc.get_project_guid(vcx_name, vcx_path) gen_filter(vcx_path + '.filters', mpir_root_dir, hf_list, c_src_list + mpn_f[1], af_list, 12.0) gen_vcxproj(vcx_path, mpir_root_dir, proj_name, guid, mp_dir, mode, Project_Type.LIB, False, hf_list, c_src_list + mpn_f[1], af_list, add_prebuild, vs_info) solc.add_project('', vcx_name, vcx_path, guid)
if loc.startswith('\\'): loc = loc[1:] mp_dir = loc if loc else config break else: mp_dir = config cf = config.replace('\\', '_') # set up DLL build proj_name = 'mpir' vcx_name = 'dll_mpir_' + cf vcx_path = abspath(join(solution_dir, vcx_name, vcx_name + '.vcxproj')) guid = solc.get_project_guid(vcx_name, vcx_path) gen_filter(vcx_path + '.filters', mpir_root_dir, hf_list, c_src_list + cc_src_list + mpn_f[1], af_list, 12.0) gen_vcxproj(vcx_path, mpir_root_dir, proj_name, guid, mp_dir, mode, Project_Type.DLL, False, hf_list, c_src_list + cc_src_list + mpn_f[1], af_list, add_prebuild, vs_info) solc.add_project('', vcx_name, vcx_path, guid, mode) # set up LIB build proj_name = 'mpir' vcx_name = 'lib_mpir_' + cf vcx_path = abspath(join(solution_dir, vcx_name, vcx_name + '.vcxproj')) guid = solc.get_project_guid(vcx_name, vcx_path) gen_filter(vcx_path + '.filters', mpir_root_dir, hf_list, c_src_list + mpn_f[1], af_list, 12.0) gen_vcxproj(vcx_path, mpir_root_dir, proj_name, guid, mp_dir, mode, Project_Type.LIB, False, hf_list, c_src_list + mpn_f[1], af_list, add_prebuild, vs_info) solc.add_project('', vcx_name, vcx_path, guid, mode) # C++ library build if add_cpp_lib:
# input any existing projects in the solution (*.sln) file solc = msvc_solution(abspath(join(solution_dir, solution_name))) if build_lib: # set up LIB build proj_name = 'lib_flint' vcx_name = 'lib_flint' vcx_path = abspath(join(solution_dir, vcx_name, vcx_name + '.vcxproj')) gen_filter(vcx_path + '.filters', flint_dir, h, c, [], '12.0') guid = solc.get_project_guid(vcx_name, vcx_path) mode = ('Win32', 'x64') inc_dirs = r'..\..\;..\..\build.vc;..\..\..\mpir\lib\$(IntDir);..\..\..\mpfr\lib\$(IntDir);..\..\..\pthreads\lib\$(IntDir)' link_libs = r'..\..\..\mpir\lib\$(IntDir)mpir.lib;..\..\..\mpfr\lib\$(IntDir)mpfr.lib;..\..\..\pthreads\lib\$(IntDir)pthreads.lib' gen_vcxproj(vcx_path, flint_dir, proj_name, guid, mode, Project_Type.LIB, flib_type, True, True, True, h, c, inc_dirs, link_libs, vs_info) solc.add_project('', vcx_name, vcx_path, guid, mode) if build_dll: # set up DLL build # no longer needed # write_def_file('dll_flint', h) proj_name = 'dll_flint' vcx_name = 'dll_flint' vcx_path = abspath(join(solution_dir, vcx_name, vcx_name + '.vcxproj')) gen_filter(vcx_path + '.filters', flint_dir, h, c, [], '12.0') guid = solc.get_project_guid(vcx_name, vcx_path) mode = ('Win32', 'x64')
else: mp_dir = config proj_name = 'mpir' cf = config.replace('\\', '_') # set up DLL build guid = '{' + str(uuid4()) + '}' vcx_name = 'dll_mpir_' + cf vcx_path = 'dll_mpir_' + cf + '\\' + vcx_name + '.vcxproj' props_path='dll_mpir_' + cf + '\\_' + vcx_name + '.props' gen_filter(vcx_path + '.filters', mpir_dir, build_dir, hf_list, c_src_list + cc_src_list + mpn_f[1], af_list, g_filters_tools_version) gen_vcxproj(proj_name, vcx_path, mpir_dir, build_dir, guid, mode, dll_type, app_str, g_tool_char_set_lines, g_project_tools_version, False, hf_list, c_src_list + cc_src_list + mpn_f[1], af_list) gen_project_props(props_path, build_dir, mp_dir, add_prebuild, False, af_list) add_proj_to_sln(solution_name, solution_dir, '', vcx_name, vcx_path, guid, g_sln_studio_version_short, g_sln_studio_version_long) # set up LIB build guid = '{' + str(uuid4()) + '}' vcx_name = 'lib_mpir_' + cf vcx_path = 'lib_mpir_' + cf + '\\' + vcx_name + '.vcxproj' props_path='lib_mpir_' + cf + '\\_' + vcx_name + '.props' gen_filter(vcx_path + '.filters', mpir_dir, build_dir, hf_list, c_src_list + mpn_f[1], af_list, g_filters_tools_version) gen_vcxproj(proj_name, vcx_path, mpir_dir, build_dir, guid, mode, lib_type, app_str, g_tool_char_set_lines, g_project_tools_version,