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 grpc_source = 11 % for source in php_config_m4.src: 12 "${source.replace('/','\\\\')} " + 13 % endfor 14 % for lib in libs: 15 % if lib.name in php_config_m4.get('deps', []) and lib.name != 'ares': 16 % for source in lib.src: 17 "${source.replace('/','\\\\')} " + 18 % endfor 19 % endif 20 % endfor 21 ""; 22 23 EXTENSION("grpc", grpc_source, null, 24 "/DOPENSSL_NO_ASM /D_GNU_SOURCE /DWIN32_LEAN_AND_MEAN "+ 25 "/D_HAS_EXCEPTIONS=0 /DNOMINMAX /DGRPC_ARES=0 /D_WIN32_WINNT=0x600 "+ 26 "/DPB_FIELD_32BIT "+ 27 "/I"+configure_module_dirname+" "+ 28 "/I"+configure_module_dirname+"\\include "+ 29 "/I"+configure_module_dirname+"\\src\\php\\ext\\grpc "+ 30 "/I"+configure_module_dirname+"\\third_party\\boringssl\\include "+ 31 "/I"+configure_module_dirname+"\\third_party\\zlib "+ 32 "/I"+configure_module_dirname+"\\third_party\\address_sorting\\include "+ 33 "/I"+configure_module_dirname+"\\third_party\\nanopb"); 34 <% 35 dirs = {} 36 for lib in libs: 37 if lib.name in php_config_m4.get('deps', []) and lib.name != 'ares': 38 for source in lib.src: 39 tmp = source 40 prev = '' 41 while (True): 42 idx = tmp.find('/'); 43 if (idx == -1): 44 break 45 dirs[prev + '\\\\' + tmp[:idx]] = 1 46 prev += ('\\\\' + tmp[:idx]); 47 tmp = tmp[idx+1:] 48 49 dirs['\\\\src'] = 1; 50 dirs['\\\\src\\\\php'] = 1; 51 dirs['\\\\src\\\\php\\\\ext'] = 1; 52 dirs['\\\\src\\\\php\\\\ext\\\\grpc'] = 1; 53 dirs = dirs.keys() 54 dirs.sort() 55 %> 56 base_dir = get_define('BUILD_DIR'); 57 FSO.CreateFolder(base_dir+"\\ext"); 58 FSO.CreateFolder(base_dir+"\\ext\\grpc"); 59 % for dir in dirs: 60 FSO.CreateFolder(base_dir+"\\ext\\grpc${dir}"); 61 % endfor 62 _build_dirs = new Array(); 63 for (i = 0; i < build_dirs.length; i++) { 64 if (build_dirs[i].indexOf('grpc') == -1) { 65 _build_dirs[_build_dirs.length] = build_dirs[i]; 66 } 67 } 68 build_dirs = _build_dirs; 69 70 } 71