Skip to content

Commit 5913ac9

Browse files
committed
Add script to make target and commit generated CgoAPI
Signed-off-by: Kevin Klues <[email protected]>
1 parent 8e51506 commit 5913ac9

File tree

4 files changed

+2144
-1
lines changed

4 files changed

+2144
-1
lines changed

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,14 @@ bindings: .create-bindings .strip-autogen-comment .strip-nvml-h-linenumber
151151
go fmt types_gen.go; \
152152
cd -> /dev/null
153153
rm -rf $(PKG_BINDINGS_DIR)/nvml.yml $(PKG_BINDINGS_DIR)/cgo_helpers.go $(PKG_BINDINGS_DIR)/types.go $(PKG_BINDINGS_DIR)/_obj
154-
go run $(GEN_BINDINGS_DIR)/generateapi.go \
154+
go run -tags generateapi \
155+
$(GEN_BINDINGS_DIR)/generateapi.go \
155156
--sourceDir $(PKG_BINDINGS_DIR) \
156157
--output $(PKG_BINDINGS_DIR)/zz_generated.api.go
158+
go run -tags generatecgoapi \
159+
$(GEN_BINDINGS_DIR)/generatecgoapi.go \
160+
--sourceDir $(PKG_BINDINGS_DIR) \
161+
--output $(PKG_BINDINGS_DIR)/zz_generated.cgoapi.go
157162
make fmt
158163

159164
.strip-autogen-comment: SED_SEARCH_STRING := // WARNING: This file has automatically been generated on

gen/nvml/generateapi.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
# limitations under the License.
1515
**/
1616

17+
//go:build generateapi
1718
package main
1819

1920
import (

gen/nvml/generatecgoapi.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/**
2+
# Copyright 2025 NVIDIA CORPORATION
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
**/
16+
17+
//go:build generatecgoapi
118
package main
219

320
import (

0 commit comments

Comments
 (0)