1%YAML 1.2 2--- | 3 // $Id$ 4 // vim:ft=javascript 5 6 ARG_WITH("grpc", "grpc support", "no"); 7 8 if (PHP_GRPC != "no") { 9 <% 10 srcs = [] 11 srcs.extend(php_config_m4.src) 12 lib_maps = {lib.name: lib for lib in libs} 13 php_deps = php_config_m4.get('deps', []) 14 php_full_deps = [] 15 for dep in php_deps: 16 php_full_deps.append(dep) 17 php_full_deps.extend(lib_maps[dep].transitive_deps) 18 for dep in php_full_deps: 19 srcs.extend(lib_maps[dep].src) 20 srcs = sorted(set(srcs)) 21 %> 22 EXTENSION("grpc", 23 % for src in srcs: 24 "${src.replace('/','\\\\')} " + 25 % endfor 26 "" 27 , null, 28 "/DOPENSSL_NO_ASM /D_GNU_SOURCE /DWIN32_LEAN_AND_MEAN "+ 29 "/D_HAS_EXCEPTIONS=0 /DNOMINMAX /DGRPC_ARES=0 /D_WIN32_WINNT=0x600 "+ 30 "/I"+configure_module_dirname+" "+ 31 "/I"+configure_module_dirname+"\\include "+ 32 "/I"+configure_module_dirname+"\\src\\core\\ext\\upb-generated "+ 33 "/I"+configure_module_dirname+"\\src\\core\\ext\\upbdefs-generated "+ 34 "/I"+configure_module_dirname+"\\src\\php\\ext\\grpc "+ 35 "/I"+configure_module_dirname+"\\third_party\\abseil-cpp "+ 36 "/I"+configure_module_dirname+"\\third_party\\address_sorting\\include "+ 37 "/I"+configure_module_dirname+"\\third_party\\boringssl-with-bazel\\src\\include "+ 38 "/I"+configure_module_dirname+"\\third_party\\re2 "+ 39 "/I"+configure_module_dirname+"\\third_party\\upb "+ 40 "/I"+configure_module_dirname+"\\third_party\\zlib "); 41 <% 42 dirs = sorted(set(src[:src.rfind('/')] for src in srcs)) 43 dirset = set(dirs) 44 for dir in dirs: 45 frags = dir.split('/') 46 for i in range(1, len(frags)): 47 dirset.add('/'.join(frags[:i])) 48 dirs = [d.replace('/', '\\\\') for d in sorted(dirset)] 49 %> 50 base_dir = get_define('BUILD_DIR'); 51 FSO.CreateFolder(base_dir+"\\ext"); 52 FSO.CreateFolder(base_dir+"\\ext\\grpc"); 53 % for dir in dirs: 54 FSO.CreateFolder(base_dir+"\\ext\\grpc\\${dir}"); 55 % endfor 56 _build_dirs = new Array(); 57 for (i = 0; i < build_dirs.length; i++) { 58 if (build_dirs[i].indexOf('grpc') == -1) { 59 _build_dirs[_build_dirs.length] = build_dirs[i]; 60 } 61 } 62 build_dirs = _build_dirs; 63 } 64