Skip to content

Commit

Permalink
Merge pull request #88 from elezar/fix-darwin
Browse files Browse the repository at this point in the history
Fix generation and build on Darwin
  • Loading branch information
elezar authored Oct 18, 2023
2 parents 2c8aa45 + 5511e83 commit f845057
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
8 changes: 3 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ PKG_BINDINGS_DIR := $(PKG_DIR)/nvml

DOCKER ?= docker
ifeq ($(shell uname),Darwin)
SED := $(DOCKER) run -it --rm -v "$(PWD):$(PWD)" -w "$(PWD)" alpine:latest sed
SED := $(DOCKER) run -i --rm -v "$(PWD):$(PWD)" -w "$(PWD)" alpine:latest sed
else
SED := sed
endif
Expand Down Expand Up @@ -54,14 +54,12 @@ TARGETS := $(MAKE_TARGETS) $(EXAMPLE_TARGETS) $(CMD_TARGETS) $(GENERATE_TARGETS)
DOCKER_TARGETS := $(patsubst %,docker-%, $(TARGETS))
.PHONY: $(TARGETS) $(DOCKER_TARGETS)

GOOS := linux

build:
GOOS=$(GOOS) go build $(MODULE)/...
go build $(MODULE)/...

examples: $(EXAMPLE_TARGETS)
$(EXAMPLE_TARGETS): example-%:
GOOS=$(GOOS) go build ./examples/$(*)
go build ./examples/$(*)

check: $(CHECK_TARGETS)

Expand Down
3 changes: 2 additions & 1 deletion gen/nvml/nvml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ GENERATOR:
limitations under the License.
Includes: ["nvml.h"]
FlagGroups:
- {name: "LDFLAGS", flags: ["-Wl,--export-dynamic","-Wl,--unresolved-symbols=ignore-in-object-files"]}
- {name: "LDFLAGS", traits: ["linux"], flags: ["-Wl,--export-dynamic","-Wl,--unresolved-symbols=ignore-in-object-files"]}
- {name: "LDFLAGS", traits: ["darwin"], flags: ["-Wl,-undefined,dynamic_lookup"]}
- {name: "CFLAGS", flags: ["-DNVML_NO_UNVERSIONED_FUNC_DEFS=1"]}
PARSER:
SourcesPaths: ["nvml.h"]
Expand Down
3 changes: 2 additions & 1 deletion pkg/nvml/const.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion pkg/nvml/nvml.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f845057

Please sign in to comment.