Zephir\Compiler::preCompileHeaders PHP Method

preCompileHeaders() public method

Pre-compile headers to speed up compilation
public preCompileHeaders ( )
    public function preCompileHeaders()
    {
        if (!Utils::isWindows()) {
            $version = self::getCurrentVersion();
            $phpIncludes = $this->getPhpIncludeDirs();
            foreach (new \DirectoryIterator('ext/kernel') as $file) {
                if (!$file->isDir()) {
                    if (preg_match('/\\.h$/', $file)) {
                        $path = $file->getRealPath();
                        if (!file_exists($path . '.gch')) {
                            $this->fileSystem->system('cd ext && gcc -c kernel/' . $file->getBaseName() . ' -I. ' . $phpIncludes . ' -o kernel/' . $file->getBaseName() . '.gch', 'stdout', $version . '/compile-header');
                        } else {
                            if (filemtime($path) > filemtime($path . '.gch')) {
                                $this->fileSystem->system('cd ext && gcc -c kernel/' . $file->getBaseName() . ' -I. ' . $phpIncludes . ' -o kernel/' . $file->getBaseName() . '.gch', 'stdout', $version . '/compile-header');
                            }
                        }
                    }
                }
            }
        }
    }