def _build_linux(working_directory_path, root_project_path): source_folder_path = _download_and_extract(working_directory_path) _patch_sources('patch_common.diff', 'patch_linux.diff', working_directory_path) project_path = os.path.join(source_folder_path, 'PhysX_3.4', 'Source', 'compiler', 'linux64') build_utils.run_process("make debug", process_cwd=project_path, shell=True) build_utils.run_process("make release", process_cwd=project_path, shell=True) #build_utils.run_process("make profile", process_cwd=project_path, shell=True) #build_utils.run_process("make checked", process_cwd=project_path, shell=True) binary_dst_path = os.path.join(root_project_path, 'Modules', 'Physics', 'Libs', 'Linux') _copy_libs(os.path.join(source_folder_path, 'PhysX_3.4', 'Lib', 'linux64'), binary_dst_path, '.a') _copy_libs(os.path.join(source_folder_path, 'PxShared', 'lib', 'linux64'), binary_dst_path, '.a') _copy_libs(os.path.join(source_folder_path, 'PhysX_3.4', 'Bin', 'linux64'), binary_dst_path, '.so') _copy_libs(os.path.join(source_folder_path, 'PxShared', 'bin', 'linux64'), binary_dst_path, '.so') _copy_headers(source_folder_path, root_project_path)
def _build_ios(working_directory_path, root_project_path): build_curl_run_dir = os.path.join(working_directory_path, 'gen/build_ios') if not os.path.exists(build_curl_run_dir): os.makedirs(build_curl_run_dir) build_curl_args = [ './build_curl', '--libcurl-version', libcurl_version, '--sdk-version', '10.2', '--arch', 'armv7,armv7s,arm64', '--run-dir', build_curl_run_dir ] if (build_utils.verbose): build_curl_args.append('--verbose') build_utils.run_process(build_curl_args, process_cwd='curl-ios-build-scripts-master') # copy libs shutil.copyfile( os.path.join(build_curl_run_dir, 'curl/ios-appstore/lib/libcurl.a'), os.path.join(root_project_path, os.path.join('Libs/lib_CMake/ios/libcurl_ios.a'))) # copy headers from original archive source_folder_path = _download_and_extract(working_directory_path) _copy_headers(source_folder_path, root_project_path)
def _download(working_directory_path): source_folder_path = os.path.join(working_directory_path, 'libuv') build_utils.run_process( ['git', 'clone', '-b', 'winuap_support', get_download_info()], process_cwd=working_directory_path, shell=True) return source_folder_path
def _build_android(working_directory_path, root_project_path): source_folder_path = _download_and_extract(working_directory_path) additional_defines = ' -D__ANDROID__ -DHAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC=1' # ARM toolchain_path_arm = build_utils.android_ndk_get_toolchain_arm() env_arm = build_utils.get_autotools_android_arm_env(toolchain_path_arm) env_arm['CFLAGS'] = env_arm['CFLAGS'] + additional_defines env_arm['CPPFLAGS'] = env_arm['CPPFLAGS'] + additional_defines install_dir_android_arm = os.path.join( working_directory_path, 'gen/install_android_arm') build_utils.run_process( ['sh', 'autogen.sh'], process_cwd=source_folder_path, environment=env_arm) build_utils.build_with_autotools( source_folder_path, ['--host=arm-linux-androideabi', '--disable-shared', '--enable-static'], install_dir_android_arm, env=env_arm) # x86 toolchain_path_x86 = build_utils.android_ndk_get_toolchain_x86() env_x86 = build_utils.get_autotools_android_x86_env(toolchain_path_x86) env_x86['CFLAGS'] = env_x86['CFLAGS'] + additional_defines env_x86['CPPFLAGS'] = env_x86['CPPFLAGS'] + additional_defines install_dir_android_x86 = os.path.join( working_directory_path, 'gen/install_android_x86') build_utils.run_process( ['sh', 'autogen.sh'], process_cwd=source_folder_path, environment=env_x86) build_utils.build_with_autotools( source_folder_path, ['--host=i686-linux-android', '--disable-shared', '--enable-static'], install_dir_android_x86, env=env_x86) libs_android_root = os.path.join(root_project_path, 'Libs/lib_CMake/android') lib_path_arm = os.path.join(install_dir_android_arm, 'lib/libuv.a') shutil.copyfile( lib_path_arm, os.path.join(libs_android_root, 'armeabi-v7a/libuv.a')) lib_path_x86 = os.path.join(install_dir_android_x86, 'lib/libuv.a') shutil.copyfile( lib_path_x86, os.path.join(libs_android_root, 'x86/libuv.a')) _copy_headers_from_install(install_dir_android_arm, root_project_path)
def _build_android(working_directory_path, root_project_path): source_folder_path = _download_and_extract(working_directory_path) _patch_sources(source_folder_path, working_directory_path) build_utils.run_process(['autoreconf', '-i'], process_cwd=source_folder_path) # ARM toolchain_path_arm = build_utils.android_ndk_get_toolchain_arm() env = build_utils.get_autotools_android_arm_env(toolchain_path_arm) env['CFLAGS'] += ' -DNDEBUG' env['CPPFLAGS'] += ' -DNDEBUG' install_dir_android_arm = os.path.join(working_directory_path, 'gen/install_android_arm') build_utils.build_with_autotools( source_folder_path, ['--host=arm-linux-androideabi', '--disable-shared', '--enable-static'], install_dir_android_arm, env=env) # x86 toolchain_path_x86 = build_utils.android_ndk_get_toolchain_x86() env = build_utils.get_autotools_android_x86_env(toolchain_path_x86) env['CFLAGS'] += ' -DNDEBUG' env['CPPFLAGS'] += ' -DNDEBUG' install_dir_android_x86 = os.path.join(working_directory_path, 'gen/install_android_x86') build_utils.build_with_autotools( source_folder_path, ['--host=i686-linux-android', '--disable-shared', '--enable-static'], install_dir_android_x86, env=env) libs_android_root = os.path.join( root_project_path, 'Libs/lib_CMake/android') libunibreak_lib_path_arm = os.path.join( install_dir_android_arm, 'lib/libunibreak.a') shutil.copyfile( libunibreak_lib_path_arm, os.path.join(libs_android_root, 'armeabi-v7a/libunibreak.a')) libunibreak_lib_path_x86 = os.path.join( install_dir_android_x86, 'lib/libunibreak.a') shutil.copyfile( libunibreak_lib_path_x86, os.path.join(libs_android_root, 'x86/libunibreak.a')) _copy_headers_from_install(install_dir_android_arm, root_project_path)
def _download(working_directory_path): source_folder_path = os.path.join(working_directory_path, 'googletest') build_utils.run_process( ['git', 'clone', get_download_info()], process_cwd=working_directory_path, shell=True) build_utils.run_process( ['git', 'checkout', 'tags/release-1.8.0'], process_cwd=source_folder_path, shell=True) return source_folder_path
def _build_win32(working_directory_path, root_project_path): source_folder_path = _download_and_extract(working_directory_path) _patch_sources(source_folder_path, working_directory_path) # x86 x86_env = build_utils.get_win32_vs_x86_env() build_utils.run_process([ 'nmake', '-f', 'Makefile.vc', 'CFG=release-static', 'RTLIBCFG=dynamic', 'OBJDIR=output' ], process_cwd=source_folder_path, environment=x86_env, shell=True) build_utils.run_process([ 'nmake', '-f', 'Makefile.vc', 'CFG=debug-static', 'RTLIBCFG=dynamic', 'OBJDIR=output' ], process_cwd=source_folder_path, environment=x86_env, shell=True) # x64 x64_env = build_utils.get_win32_vs_x64_env() build_utils.run_process([ 'nmake', '-f', 'Makefile.vc', 'CFG=release-static', 'RTLIBCFG=dynamic', 'OBJDIR=output' ], process_cwd=source_folder_path, environment=x64_env, shell=True) build_utils.run_process([ 'nmake', '-f', 'Makefile.vc', 'CFG=debug-static', 'RTLIBCFG=dynamic', 'OBJDIR=output' ], process_cwd=source_folder_path, environment=x64_env, shell=True) libs_win_root = os.path.join(root_project_path, 'Libs/lib_CMake/win') shutil.copyfile( os.path.join(source_folder_path, 'output/debug-static/x86/lib/libwebp_debug.lib'), os.path.join(libs_win_root, 'x86/Debug/libwebp.lib')) shutil.copyfile( os.path.join(source_folder_path, 'output/release-static/x86/lib/libwebp.lib'), os.path.join(libs_win_root, 'x86/Release/libwebp.lib')) shutil.copyfile( os.path.join(source_folder_path, 'output/debug-static/x64/lib/libwebp_debug.lib'), os.path.join(libs_win_root, 'x64/Debug/libwebp.lib')) shutil.copyfile( os.path.join(source_folder_path, 'output/release-static/x64/lib/libwebp.lib'), os.path.join(libs_win_root, 'x64/Release/libwebp.lib')) _copy_headers(source_folder_path, root_project_path)
def _patch_sources(source_folder_path, working_directory_path, patch_file_path): try: if source_folder_path in _patch_sources.cache: return except AttributeError: _patch_sources.cache = [] pass shutil.copyfile('WIN32.MAK', os.path.join(source_folder_path, 'WIN32.MAK')) build_utils.run_process(['nmake', '/f', 'makefile.vc', 'setup-v10'], process_cwd=source_folder_path, shell=True, environment=build_utils.get_win32_vs_x86_env()) build_utils.apply_patch(os.path.abspath(patch_file_path), working_directory_path) _patch_sources.cache.append(source_folder_path)
def _build_linux(working_directory_path, root_project_path): source_folder_path = _download_and_extract(working_directory_path) env = build_utils.get_autotools_linux_env() build_utils.run_process(['autoreconf', '-i'], process_cwd=source_folder_path) install_dir = os.path.join(working_directory_path, 'gen/install_linux') build_utils.build_with_autotools( source_folder_path, ['--disable-shared', '--enable-static'], install_dir, env=env) lib_path = os.path.join(install_dir, 'lib/libunibreak.a') shutil.copyfile( lib_path, os.path.join(root_project_path, 'Libs/lib_CMake/linux/libunibreak.a')) _copy_headers_from_install(install_dir, root_project_path)
def _build_macos(working_directory_path, root_project_path): source_folder_path = _download_and_extract(working_directory_path) env = build_utils.get_autotools_macos_env() install_dir_macos = os.path.join( working_directory_path, 'gen/install_macos') build_utils.run_process( ['sh', 'autogen.sh'], process_cwd=source_folder_path, environment=env) build_utils.build_with_autotools( source_folder_path, ['--host=x86_64-apple-darwin', '--disable-shared', '--enable-static'], install_dir_macos, env=env) lib_path = os.path.join(install_dir_macos, 'lib/libuv.a') shutil.copyfile( lib_path, os.path.join(root_project_path, 'Libs/lib_CMake/mac/libuv_macos.a')) _copy_headers_from_install(install_dir_macos, root_project_path)
def _build_linux(working_directory_path, root_project_path): source_folder_path = _download_and_extract(working_directory_path) # Clone gyp build_utils.run_process( ['git clone https://chromium.googlesource.com/external/gyp.git build/gyp'], process_cwd=source_folder_path, shell=True) # Generate makefile using gyp env = build_utils.get_autotools_linux_env() build_utils.run_process( ['./gyp_uv.py -f make'], process_cwd=source_folder_path, environment=env, shell=True) # Build release library: only libuv.a, skipping tests build_utils.run_process( ['BUILDTYPE=Release make libuv -C out'], process_cwd=source_folder_path, environment=env, shell=True) # Copy binary files to dava.engine's library folder source_dir = os.path.join(source_folder_path, 'out/Release') target_dir = os.path.join(root_project_path, 'Libs/lib_CMake/linux') shutil.copyfile(os.path.join(source_dir, 'libuv.a'), os.path.join(target_dir, 'libuv.a')) # Copy headers to dava.engine's include folder _copy_headers_from_install(source_folder_path, root_project_path)
def _build_ios(working_directory_path, root_project_path): source_folder_path = _download_and_extract(working_directory_path) _patch_sources(source_folder_path, working_directory_path) install_dir_ios = os.path.join(working_directory_path, 'gen/install_ios') build_utils.run_process(['autoreconf', '-i'], process_cwd=source_folder_path) env=build_utils.get_autotools_ios_env() env['CFLAGS'] += ' -DNDEBUG' env['CXXFLAGS'] += ' -DNDEBUG' build_utils.build_with_autotools( source_folder_path, ['--host=armv7-apple-darwin', '--disable-shared', '--enable-static'], install_dir_ios, env=env) libunibreak_lib_path = os.path.join(install_dir_ios, 'lib/libunibreak.a') shutil.copyfile( libunibreak_lib_path, os.path.join( root_project_path, 'Libs/lib_CMake/ios/libunibreak_ios.a')) _copy_headers_from_install(install_dir_ios, root_project_path)
def _build_win32(working_directory_path, root_project_path): libraries_win_root = os.path.join(root_project_path, 'Libs/lib_CMake/win') # x86 source_folder_path_x86 = _download_and_extract(working_directory_path, 'win32_x86') shutil.copyfile('build-msvc.cmd', os.path.join(source_folder_path_x86, 'build-msvc.cmd')) build_utils.run_process('build-msvc.cmd', process_cwd=source_folder_path_x86, shell=True, environment=build_utils.get_win32_vs_x86_env()) libeay_path_x86_debug = os.path.join(source_folder_path_x86, 'out32.dbg/libeay32.lib') ssleay_path_x86_debug = os.path.join(source_folder_path_x86, 'out32.dbg/ssleay32.lib') libeay_path_x86_release = os.path.join(source_folder_path_x86, 'out32/libeay32.lib') ssleay_path_x86_release = os.path.join(source_folder_path_x86, 'out32/ssleay32.lib') shutil.copyfile(libeay_path_x86_debug, os.path.join(libraries_win_root, 'x86/Debug/libeay32.lib')) shutil.copyfile(ssleay_path_x86_debug, os.path.join(libraries_win_root, 'x86/Debug/ssleay32.lib')) shutil.copyfile( libeay_path_x86_release, os.path.join(libraries_win_root, 'x86/Release/libeay32.lib')) shutil.copyfile( ssleay_path_x86_release, os.path.join(libraries_win_root, 'x86/Release/ssleay32.lib')) #x64 source_folder_path_x64 = _download_and_extract(working_directory_path, 'win32_x64') shutil.copyfile('build-msvc.cmd', os.path.join(source_folder_path_x64, 'build-msvc.cmd')) build_utils.run_process(['build-msvc.cmd', 'x64'], process_cwd=source_folder_path_x64, shell=True, environment=build_utils.get_win32_vs_x64_env()) libeay_path_x64_debug = os.path.join(source_folder_path_x64, 'out32.dbg/libeay32.lib') ssleay_path_x64_debug = os.path.join(source_folder_path_x64, 'out32.dbg/ssleay32.lib') libeay_path_x64_release = os.path.join(source_folder_path_x64, 'out32/libeay32.lib') ssleay_path_x64_release = os.path.join(source_folder_path_x64, 'out32/ssleay32.lib') shutil.copyfile(libeay_path_x64_debug, os.path.join(libraries_win_root, 'x64/Debug/libeay32.lib')) shutil.copyfile(ssleay_path_x64_debug, os.path.join(libraries_win_root, 'x64/Debug/ssleay32.lib')) shutil.copyfile( libeay_path_x64_release, os.path.join(libraries_win_root, 'x64/Release/libeay32.lib')) shutil.copyfile( ssleay_path_x64_release, os.path.join(libraries_win_root, 'x64/Release/ssleay32.lib')) # headers headers_x86_src = os.path.join(source_folder_path_x86, 'inc32/openssl') headers_x64_src = os.path.join(source_folder_path_x64, 'inc32/openssl') headers_x86_dst = _headers_include_path(root_project_path, 'win32/x86') headers_x64_dst = _headers_include_path(root_project_path, 'win32/x64') build_utils.copy_folder_recursive(headers_x86_src, headers_x86_dst) build_utils.copy_folder_recursive(headers_x64_src, headers_x64_dst)
def _build_win10(working_directory_path, root_project_path): source_folder_path = _download_and_extract(working_directory_path, 'win10') build_utils.run_process(['ms\\do_vsprojects14.bat'], process_cwd=source_folder_path, shell=True) vs_solution_path = 'vsout/NT-Universal-10.0-Static-Unicode/NT-Universal-10.0-Static-Unicode.vcxproj' build_utils.build_vs(os.path.join(source_folder_path, vs_solution_path), 'Debug', 'Win32') build_utils.build_vs(os.path.join(source_folder_path, vs_solution_path), 'Release', 'Win32') build_utils.build_vs(os.path.join(source_folder_path, vs_solution_path), 'Debug', 'x64') build_utils.build_vs(os.path.join(source_folder_path, vs_solution_path), 'Release', 'x64') build_utils.build_vs(os.path.join(source_folder_path, vs_solution_path), 'Debug', 'ARM') build_utils.build_vs(os.path.join(source_folder_path, vs_solution_path), 'Release', 'ARM') build_utils.run_process(['ms\\do_packwinuniversal.bat'], process_cwd=source_folder_path, shell=True) package_folder_path = os.path.join(source_folder_path, 'vsout/package') libs_folder_path = os.path.join(package_folder_path, 'lib/Universal/10.0/Static/Unicode') libraries_win10_root = os.path.join(root_project_path, 'Libs/lib_CMake/win10') libssl_path_x86_debug = os.path.join(libs_folder_path, 'Debug/Win32/ssleay32.lib') libcrypto_path_x86_debug = os.path.join(libs_folder_path, 'Debug/Win32/libeay32.lib') shutil.copyfile( libssl_path_x86_debug, os.path.join(libraries_win10_root, 'Win32/Debug/ssleay32.lib')) shutil.copyfile( libcrypto_path_x86_debug, os.path.join(libraries_win10_root, 'Win32/Debug/libeay32.lib')) libssl_path_x86_release = os.path.join(libs_folder_path, 'Release/Win32/ssleay32.lib') libcrypto_path_x86_release = os.path.join(libs_folder_path, 'Release/Win32/libeay32.lib') shutil.copyfile( libssl_path_x86_release, os.path.join(libraries_win10_root, 'Win32/Release/ssleay32.lib')) shutil.copyfile( libcrypto_path_x86_release, os.path.join(libraries_win10_root, 'Win32/Release/libeay32.lib')) libssl_path_x64_debug = os.path.join(libs_folder_path, 'Debug/x64/ssleay32.lib') libcrypto_path_x64_debug = os.path.join(libs_folder_path, 'Debug/x64/libeay32.lib') shutil.copyfile( libssl_path_x64_debug, os.path.join(libraries_win10_root, 'x64/Debug/ssleay32.lib')) shutil.copyfile( libcrypto_path_x64_debug, os.path.join(libraries_win10_root, 'x64/Debug/libeay32.lib')) libssl_path_x64_release = os.path.join(libs_folder_path, 'Release/x64/ssleay32.lib') libcrypto_path_x64_release = os.path.join(libs_folder_path, 'Release/x64/libeay32.lib') shutil.copyfile( libssl_path_x64_release, os.path.join(libraries_win10_root, 'x64/Release/ssleay32.lib')) shutil.copyfile( libcrypto_path_x64_release, os.path.join(libraries_win10_root, 'x64/Release/libeay32.lib')) libssl_path_arm_debug = os.path.join(libs_folder_path, 'Debug/arm/ssleay32.lib') libcrypto_path_arm_debug = os.path.join(libs_folder_path, 'Debug/arm/libeay32.lib') shutil.copyfile( libssl_path_arm_debug, os.path.join(libraries_win10_root, 'arm/Debug/ssleay32.lib')) shutil.copyfile( libcrypto_path_arm_debug, os.path.join(libraries_win10_root, 'arm/Debug/libeay32.lib')) libssl_path_arm_release = os.path.join(libs_folder_path, 'Release/arm/ssleay32.lib') libcrypto_path_arm_release = os.path.join(libs_folder_path, 'Release/arm/libeay32.lib') shutil.copyfile( libssl_path_arm_release, os.path.join(libraries_win10_root, 'arm/Release/ssleay32.lib')) shutil.copyfile( libcrypto_path_arm_release, os.path.join(libraries_win10_root, 'arm/Release/libeay32.lib')) _copy_headers(package_folder_path, root_project_path, 'uwp')
def _build_win32(working_directory_path, root_project_path): source_folder_path = _download_and_extract(working_directory_path) build_utils.apply_patch( os.path.abspath('patch_debug_and_dynamic_runtime.diff'), working_directory_path) # Build only detours library excluding examples makefile_path = os.path.join(source_folder_path, 'src') # x86 debug build env = build_utils.get_win32_vs_x86_env() env['DETOURS_TARGET_PROCESSOR'] = 'X86' env['DETOURS_RUNTIME'] = 'DYNAMIC' env['DETOURS_BUILD_MODE'] = 'DEBUG' env['DETOURS_CONFIG'] = '.debug' build_utils.run_process(['nmake'], process_cwd=makefile_path, shell=True, environment=env) # x86 release build env = build_utils.get_win32_vs_x86_env() env['DETOURS_TARGET_PROCESSOR'] = 'X86' env['DETOURS_RUNTIME'] = 'DYNAMIC' env['DETOURS_BUILD_MODE'] = 'RELEASE' env['DETOURS_CONFIG'] = '.release' build_utils.run_process(['nmake'], process_cwd=makefile_path, shell=True, environment=env) # x64 debug build env = build_utils.get_win32_vs_x64_env() env['DETOURS_TARGET_PROCESSOR'] = 'X64' env['DETOURS_RUNTIME'] = 'DYNAMIC' env['DETOURS_BUILD_MODE'] = 'DEBUG' env['DETOURS_CONFIG'] = '.debug' build_utils.run_process(['nmake'], process_cwd=makefile_path, shell=True, environment=env) # x64 release build env = build_utils.get_win32_vs_x64_env() env['DETOURS_TARGET_PROCESSOR'] = 'X64' env['DETOURS_RUNTIME'] = 'DYNAMIC' env['DETOURS_BUILD_MODE'] = 'RELEASE' env['DETOURS_CONFIG'] = '.release' build_utils.run_process(['nmake'], process_cwd=makefile_path, shell=True, environment=env) libraries_win_root = os.path.join(root_project_path, 'Libs/lib_CMake/win') shutil.copyfile( os.path.join(source_folder_path, 'lib.X86.debug/detours.lib'), os.path.join(libraries_win_root, 'x86/Debug/detours.lib')) shutil.copyfile( os.path.join(source_folder_path, 'lib.X86.release/detours.lib'), os.path.join(libraries_win_root, 'x86/Release/detours.lib')) shutil.copyfile( os.path.join(source_folder_path, 'lib.X64.debug/detours.lib'), os.path.join(libraries_win_root, 'x64/Debug/detours.lib')) shutil.copyfile( os.path.join(source_folder_path, 'lib.X64.release/detours.lib'), os.path.join(libraries_win_root, 'x64/Release/detours.lib')) _copy_headers(source_folder_path, root_project_path)
def _build_win32(working_directory_path, root_project_path): source_folder_path = _download_and_extract(working_directory_path) _patch_sources_windows(source_folder_path, working_directory_path) """ Build instructions for libxml2 v2.7.8 """ libraries_win_root = os.path.join(root_project_path, 'Libs/lib_CMake/win') makefile_path = os.path.join(source_folder_path, 'win32') cscript_debug = [ 'cscript', 'configure.js', 'compiler=msvc', 'static=yes', 'iconv=no', 'ftp=no', 'http=no', 'cruntime=/MDd', 'debug=yes' ] cscript_release = [ 'cscript', 'configure.js', 'compiler=msvc', 'static=yes', 'iconv=no', 'ftp=no', 'http=no', 'cruntime=/MD', 'debug=no' ] nmake_clean = ['nmake', 'clean'] # Generate makefile for debug build build_utils.run_process(cscript_debug, process_cwd=makefile_path, shell=True, environment=None) # Build and copy x86 debug static lib build_utils.run_process(['nmake', '/f', 'Makefile', 'libxmla'], process_cwd=makefile_path, shell=True, environment=build_utils.get_win32_vs_x86_env()) shutil.copyfile(os.path.join(makefile_path, 'bin.msvc/libxml2_a.lib'), os.path.join(libraries_win_root, 'x86/Debug/libxml2.lib')) build_utils.run_process(nmake_clean, process_cwd=makefile_path, shell=True, environment=build_utils.get_win32_vs_x86_env()) # Build and copy x64 debug static lib build_utils.run_process(['nmake', '/f', 'Makefile', 'libxmla'], process_cwd=makefile_path, shell=True, environment=build_utils.get_win32_vs_x64_env()) shutil.copyfile(os.path.join(makefile_path, 'bin.msvc/libxml2_a.lib'), os.path.join(libraries_win_root, 'x64/Debug/libxml2.lib')) build_utils.run_process(nmake_clean, process_cwd=makefile_path, shell=True, environment=build_utils.get_win32_vs_x64_env()) # Generate makefile for release build build_utils.run_process(cscript_release, process_cwd=makefile_path, shell=True, environment=None) # Build and copy x86 release static lib build_utils.run_process(['nmake', '/f', 'Makefile', 'libxmla'], process_cwd=makefile_path, shell=True, environment=build_utils.get_win32_vs_x86_env()) shutil.copyfile( os.path.join(makefile_path, 'bin.msvc/libxml2_a.lib'), os.path.join(libraries_win_root, 'x86/Release/libxml2.lib')) build_utils.run_process(nmake_clean, process_cwd=makefile_path, shell=True, environment=build_utils.get_win32_vs_x86_env()) # Build and copy x64 release static lib build_utils.run_process(['nmake', '/f', 'Makefile', 'libxmla'], process_cwd=makefile_path, shell=True, environment=build_utils.get_win32_vs_x64_env()) shutil.copyfile( os.path.join(makefile_path, 'bin.msvc/libxml2_a.lib'), os.path.join(libraries_win_root, 'x64/Release/libxml2.lib')) build_utils.run_process(nmake_clean, process_cwd=makefile_path, shell=True, environment=build_utils.get_win32_vs_x64_env()) """ Build instructions for libxml2 v2.9.0 and later sln_path = os.path.join(source_folder_path, 'win32/VC10/libxml2.sln') build_utils.build_vs(sln_path, 'Debug', 'Win32', target='libxml2', toolset=build_config.get_msvc_toolset_ver_win32()) build_utils.build_vs(sln_path, 'Release', 'Win32', target='libxml2', toolset=build_config.get_msvc_toolset_ver_win32()) build_utils.build_vs(sln_path, 'Debug', 'x64', target='libxml2', toolset=build_config.get_msvc_toolset_ver_win32()) build_utils.build_vs(sln_path, 'Release', 'x64', target='libxml2', toolset=build_config.get_msvc_toolset_ver_win32()) libraries_win_root = os.path.join(root_project_path, 'Libs/lib_CMake/win') lib_path_x86_debug = os.path.join( source_folder_path, 'win32/VC10/Debug/libxml2.lib') lib_path_x86_release = os.path.join( source_folder_path, 'win32/VC10/Release/libxml2.lib') shutil.copyfile( lib_path_x86_debug, os.path.join(libraries_win_root, 'x86/Debug/libxml2.lib')) shutil.copyfile( lib_path_x86_release, os.path.join(libraries_win_root, 'x86/Release/libxml2.lib')) lib_path_x64_debug = os.path.join( source_folder_path, 'win32/VC10/x64/Debug/libxml2.lib') lib_path_x64_release = os.path.join( source_folder_path, 'win32/VC10/x64/Release/libxml2.lib') shutil.copyfile( lib_path_x64_debug, os.path.join(libraries_win_root, 'x64/Debug/libxml2.lib')) shutil.copyfile( lib_path_x64_release, os.path.join(libraries_win_root, 'x64/Release/libxml2.lib')) """ _copy_headers(source_folder_path, root_project_path)
def _build_win32(working_directory_path, root_project_path): source_folder_path = _download(working_directory_path) build_folder_path = os.path.join(working_directory_path, 'gen/build_win32') build_folder_path_x86 = os.path.join(build_folder_path, 'x86') build_folder_path_x86_debug = os.path.join(build_folder_path_x86, 'Debug') build_folder_path_x86_release = os.path.join(build_folder_path_x86, 'Release') build_folder_path_x64 = os.path.join(build_folder_path, 'x64') build_folder_path_x64_debug = os.path.join(build_folder_path_x64, 'Debug') build_folder_path_x64_release = os.path.join(build_folder_path_x64, 'Release') os.makedirs(build_folder_path_x86_debug) os.makedirs(build_folder_path_x86_release) os.makedirs(build_folder_path_x64_debug) os.makedirs(build_folder_path_x64_release) vc_solution_file=os.path.join(source_folder_path, 'uv.sln') override_props_file=os.path.abspath('override_win32.props') toolset=build_config.get_msvc_toolset_ver_win32() msbuild_args=[ "/p:ForceImportBeforeCppTargets={}".format(override_props_file), "/p:WindowsTargetPlatformVersion={}".format(build_config.get_msvc_sdk_version_win32()) ] # x86 x86_env = build_utils.get_win32_vs_x86_env() x86_env['GYP_MSVS_VERSION'] = build_config.get_gyp_msvs_version() build_utils.run_process( ['vcbuild.bat', 'x86', 'nobuild'], process_cwd=source_folder_path, environment=x86_env, shell=True) build_utils.build_vs(vc_solution_file, 'Debug', 'Win32', 'libuv', toolset, msbuild_args=msbuild_args) build_utils.build_vs(vc_solution_file, 'Release', 'Win32', 'libuv', toolset, msbuild_args=msbuild_args) lib_path_x86_debug = os.path.join(build_folder_path_x86_debug, 'libuv.lib') lib_path_x86_release = os.path.join(build_folder_path_x86_release, 'libuv.lib') shutil.copyfile( os.path.join(source_folder_path, 'Debug/lib/libuv.lib'), lib_path_x86_debug) shutil.copyfile( os.path.join(source_folder_path, 'Release/lib/libuv.lib'), lib_path_x86_release) build_utils.run_process( ['vcbuild.bat', 'clean'], process_cwd=source_folder_path, environment=x86_env, shell=True) # x64 x64_env = build_utils.get_win32_vs_x64_env() x64_env['GYP_MSVS_VERSION'] = build_config.get_gyp_msvs_version() build_utils.run_process( ['vcbuild.bat', 'x64', 'nobuild'], process_cwd=source_folder_path, environment=x64_env, shell=True) build_utils.build_vs(vc_solution_file, 'Debug', 'x64', 'libuv', toolset, msbuild_args=msbuild_args) build_utils.build_vs(vc_solution_file, 'Release', 'x64', 'libuv', toolset, msbuild_args=msbuild_args) lib_path_x64_debug = os.path.join(build_folder_path_x64_debug, 'libuv.lib') lib_path_x64_release = os.path.join(build_folder_path_x64_release, 'libuv.lib') shutil.copyfile( os.path.join(source_folder_path, 'Debug/lib/libuv.lib'), lib_path_x64_debug) shutil.copyfile( os.path.join(source_folder_path, 'Release/lib/libuv.lib'), lib_path_x64_release) # copy libs libs_win_root = os.path.join(root_project_path, 'Libs/lib_CMake/win') shutil.copyfile( lib_path_x86_debug, os.path.join(libs_win_root, 'x86/Debug/libuv.lib')) shutil.copyfile( lib_path_x86_release, os.path.join(libs_win_root, 'x86/Release/libuv.lib')) shutil.copyfile( lib_path_x64_debug, os.path.join(libs_win_root, 'x64/Debug/libuv.lib')) shutil.copyfile( lib_path_x64_release, os.path.join(libs_win_root, 'x64/Release/libuv.lib')) _copy_headers(source_folder_path, root_project_path)
def _build_win32(working_directory_path, root_project_path): source_folder_path, c99_to_c89_folder_path = _download_and_extract( working_directory_path) _patch_sources(source_folder_path, working_directory_path) install_path_debug_x86 = os.path.join(working_directory_path, 'gen/install_win32_debug_x86') install_path_debug_x64 = os.path.join(working_directory_path, 'gen/install_win32_debug_x64') install_path_release_x86 = os.path.join(working_directory_path, 'gen/install_win32_release_x86') install_path_release_x64 = os.path.join(working_directory_path, 'gen/install_win32_release_x64') msys2_cmd_template = ['msys2_shell.cmd', '-use-full-path', '-l', '-c'] # make clean is so dumb bash_arg_clean_part = (' && make clean && rm compat/msvcrt/snprintf.d' ' && rm compat/msvcrt/snprintf.o' ' && rm compat/strtod.o && rm compat/strtod.d') bash_arg_template = ('cd {} && ./configure {} && ' 'make && make install' + bash_arg_clean_part) configure_args_debug_template = ( '--toolchain=msvc --prefix={} --disable-all --enable-static ' '--disable-shared --enable-avcodec --enable-avdevice --enable-avfilter ' '--enable-avformat --enable-swresample --enable-swscale ' '--enable-gpl --enable-postproc') configure_args_release_template = configure_args_debug_template + ' --disable-debug' env_x86 = build_utils.get_win32_vs_x86_env() env_x64 = build_utils.get_win32_vs_x64_env() env_x86['PATH'] = c99_to_c89_folder_path + ';' + env_x86['PATH'] env_x64['PATH'] = c99_to_c89_folder_path + ';' + env_x64['PATH'] configure_args_debug_x86 = configure_args_debug_template.format( _path_to_msys_path(install_path_debug_x86)) bash_arg = bash_arg_template.format(_path_to_msys_path(source_folder_path), configure_args_debug_x86) cmd = msys2_cmd_template[:] cmd.append(bash_arg) build_utils.run_process(cmd, process_cwd=source_folder_path, environment=env_x86) configure_args_release_x86 = configure_args_release_template.format( _path_to_msys_path(install_path_release_x86)) bash_arg = bash_arg_template.format(_path_to_msys_path(source_folder_path), configure_args_release_x86) cmd = msys2_cmd_template[:] cmd.append(bash_arg) build_utils.run_process(cmd, process_cwd=source_folder_path, environment=env_x86) configure_args_debug_x64 = configure_args_debug_template.format( _path_to_msys_path(install_path_debug_x64)) bash_arg = bash_arg_template.format(_path_to_msys_path(source_folder_path), configure_args_debug_x64) cmd = msys2_cmd_template[:] cmd.append(bash_arg) build_utils.run_process(cmd, process_cwd=source_folder_path, environment=env_x64) configure_args_release_x64 = configure_args_release_template.format( _path_to_msys_path(install_path_release_x64)) bash_arg = bash_arg_template.format(_path_to_msys_path(source_folder_path), configure_args_release_x64) cmd = msys2_cmd_template[:] cmd.append(bash_arg) build_utils.run_process(cmd, process_cwd=source_folder_path, environment=env_x64) _copy_headers(install_path_debug_x86, root_project_path) _copy_libraries( install_path_debug_x86, os.path.join(root_project_path, 'Libs/lib_CMake/win/x86/Debug/')) _copy_libraries( install_path_release_x86, os.path.join(root_project_path, 'Libs/lib_CMake/win/x86/Release/')) _copy_libraries( install_path_debug_x64, os.path.join(root_project_path, 'Libs/lib_CMake/win/x64/Debug/')) _copy_libraries( install_path_release_x64, os.path.join(root_project_path, 'Libs/lib_CMake/win/x64/Release/'))