watcher: drop ldflags from compile-only invocation

The shell invocation runs `$CXX -c` to compile watcher-c.cpp to a .o,
which never links. Passing linker flags to a compile-only step is
either ignored or, with some flags, an error. Drop them.
This commit is contained in:
henderkes
2026-05-24 20:54:44 +07:00
parent 7ae5d742c2
commit 0807e9e253

View File

@@ -20,9 +20,8 @@ class watcher extends LibraryPackage
if (stripos($cflags, '-fpic') === false) {
$cflags .= ' -fPIC';
}
$ldflags = $this->getLibExtraLdFlags() ? ' ' . $this->getLibExtraLdFlags() : '';
shell()->cd("{$this->getSourceDir()}/watcher-c")
->exec(getenv('CXX') . " -c -o libwatcher-c.o ./src/watcher-c.cpp -I ./include -I ../include -std=c++17 -Wall -Wextra {$cflags}{$ldflags}")
->exec(getenv('CXX') . " -c -o libwatcher-c.o ./src/watcher-c.cpp -I ./include -I ../include -std=c++17 -Wall -Wextra {$cflags}")
->exec(getenv('AR') . ' rcs libwatcher-c.a libwatcher-c.o');
copy("{$this->getSourceDir()}/watcher-c/libwatcher-c.a", "{$this->getLibDir()}/libwatcher-c.a");