Skip to content

Commit

Permalink
Update Builder.php
Browse files Browse the repository at this point in the history
  • Loading branch information
matyhtf authored Oct 8, 2019
1 parent 8762b4b commit 9257da9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions console/src/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public function link()
}

$link_option = ' -L./lib';
$libs = trim(`php-config --libs`);
$libs = self::PHPX_LFLAGS;
$ldflags = trim(`php-config --ldflags`);

/**
Expand All @@ -243,15 +243,14 @@ public function link()

if ($this->isExtension()) {
$link_option .= ' -shared';
$libs .= " " . self::PHPX_LFLAGS;
/**
* MacOS 需要增加连接参数
*/
if (strcasecmp(PHP_OS, "Darwin") === 0) {
$link_option .= " -undefined dynamic_lookup";
}
} else {
$libs .= " " . self::PHPX_LFLAGS . ' -lphp7';
$libs .= ' -lphp7';
}

$this->exec(self::CXX . " $objects {$ldflags} {$libs} {$this->ldflags} {$link_option} -o {$this->target}");
Expand Down

0 comments on commit 9257da9

Please sign in to comment.