2 with allow_unsafe_import():
6 def get_fbcode_platform():
7 return read_config('cxx', 'default_platform')
9 def get_compiler_type(platform):
10 if read_config('cxx#{}'.format(platform), 'cc_type') == 'clang':
15 def is_opt_hhvm_build():
16 buck_out = read_config('project', 'buck_out')
17 return '/opt' in buck_out
19 def is_dev_hhvm_build():
20 return '/dev' in read_config('project', 'buck_out')
22 def is_lto_build(platform):
23 flags = read_config('cxx#{}'.format(platform), 'cxxflags')
24 return " -flto " in flags
26 def find_systemlib_files(dir, skip):
27 find_cmd = [ 'find', dir, '-type', 'f', '-name', 'ext_*.php' ]
28 proc = subprocess.Popen(find_cmd, stdout=subprocess.PIPE)
29 files = str(proc.stdout.read().decode('ascii')).split('\n')
30 return sorted(map(lambda x: x[len(dir) if skip else 0:],
31 filter(lambda x: x[:len(dir)] == dir, files)))
33 def get_platform_machine():
34 return platform.machine()