Skip to content

Commit 487915e

Browse files
committed
Use GOHOSTOS to switch journald plugin build
This plugin requires libsystemd to compile, which is only available on Linux. This uses `go env` to determine if the current build platform can support this or not, and if not, disables the building of the plugin to allow compilation on Windows and macOS platforms. Signed-off-by: Sean McGinnis <[email protected]>
1 parent 7e7bc22 commit 487915e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ IMAGE:=$(REGISTRY)/node-problem-detector:$(TAG)
5353
# support needs libsystemd-dev or libsystemd-journal-dev.
5454
ENABLE_JOURNALD?=1
5555

56-
ifeq ($(shell uname -s 2>/dev/null), Darwin)
56+
ifeq ($(go env GOHOSTOS), darwin)
57+
ENABLE_JOURNALD=0
58+
else ifeq ($(go env GOHOSTOS), windows)
5759
ENABLE_JOURNALD=0
5860
endif
5961

0 commit comments

Comments
 (0)