aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates/config.w32.template
blob: 5e37cf568c2df8cbc631b30a3d3d7d2765bb9d8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
%YAML 1.2
--- |
  // $Id$
  // vim:ft=javascript

  ARG_WITH("grpc", "grpc support", "no");

  if (PHP_GRPC != "no") {

    grpc_source =
      % for source in php_config_m4.src:
      "${source.replace('/','\\\\')} " +
      % endfor
      % for lib in libs:
      % if lib.name in php_config_m4.get('deps', []) and lib.name != 'ares':
      % for source in lib.src:
      "${source.replace('/','\\\\')} " +
      % endfor
      % endif
      % endfor
      "";

    EXTENSION("grpc", grpc_source, null,
      "/DOPENSSL_NO_ASM /D_GNU_SOURCE /DWIN32_LEAN_AND_MEAN "+
      "/D_HAS_EXCEPTIONS=0 /DNOMINMAX /DGRPC_ARES=0 /D_WIN32_WINNT=0x600 "+
      "/DPB_FIELD_32BIT "+
      "/I"+configure_module_dirname+" "+
      "/I"+configure_module_dirname+"\\include "+
      "/I"+configure_module_dirname+"\\src\\php\\ext\\grpc "+
      "/I"+configure_module_dirname+"\\third_party\\boringssl\\include "+
      "/I"+configure_module_dirname+"\\third_party\\zlib "+
      "/I"+configure_module_dirname+"\\third_party\\address_sorting\\include "+
      "/I"+configure_module_dirname+"\\third_party\\nanopb");
  <%
    dirs = {}
    for lib in libs:
      if lib.name in php_config_m4.get('deps', []) and lib.name != 'ares':
        for source in lib.src:
          tmp = source
          prev = ''
          while (True):
            idx = tmp.find('/');
            if (idx == -1):
              break
            dirs[prev + '\\\\' + tmp[:idx]] = 1
            prev += ('\\\\' + tmp[:idx]);
            tmp = tmp[idx+1:]
            
    dirs['\\\\src'] = 1;
    dirs['\\\\src\\\\php'] = 1;
    dirs['\\\\src\\\\php\\\\ext'] = 1;
    dirs['\\\\src\\\\php\\\\ext\\\\grpc'] = 1;
    dirs = dirs.keys()
    dirs.sort()
  %>
    base_dir = get_define('BUILD_DIR');
    FSO.CreateFolder(base_dir+"\\ext");
    FSO.CreateFolder(base_dir+"\\ext\\grpc");
    % for dir in dirs:
    FSO.CreateFolder(base_dir+"\\ext\\grpc${dir}");
    % endfor
    _build_dirs = new Array();
    for (i = 0; i < build_dirs.length; i++) {
      if (build_dirs[i].indexOf('grpc') == -1) {
        _build_dirs[_build_dirs.length] = build_dirs[i];
      }
    }
    build_dirs = _build_dirs;

  }