diff --git a/.bazelrc b/.bazelrc index ca3b6d1c..628f05cc 100644 --- a/.bazelrc +++ b/.bazelrc @@ -2,6 +2,8 @@ build --enable_platform_specific_config build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + build:windows --copt=/utf-8 build:windows --copt=/Zc:preprocessor build:windows --cxxopt=/std:c++17 diff --git a/.gitignore b/.gitignore index 5323cb6f..b5fd35bc 100644 --- a/.gitignore +++ b/.gitignore @@ -275,3 +275,4 @@ desktop.iniimages/ # Ignore all bazel-* symlinks. There is no full list since this can change # based on the name of the directory bazel is cloned into. /bazel-* +MODULE.bazel.lock diff --git a/BUILD.bazel b/BUILD.bazel index 53bca68b..6082bc4b 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -1,3 +1,5 @@ +load("@rules_cc//cc:defs.bzl", "cc_library") + cc_library( name = "argparse", hdrs = ["include/argparse/argparse.hpp"], diff --git a/MODULE.bazel b/MODULE.bazel new file mode 100644 index 00000000..cd1f3ecf --- /dev/null +++ b/MODULE.bazel @@ -0,0 +1,7 @@ +module( + name = "argparse", + version = "3.2.0", + compatibility_level = 1, +) + +bazel_dep(name = "rules_cc", version = "0.2.14") diff --git a/samples/add_sample.bzl b/samples/add_sample.bzl index 13dfd2f5..013868e3 100644 --- a/samples/add_sample.bzl +++ b/samples/add_sample.bzl @@ -1,5 +1,7 @@ +load("@rules_cc//cc:defs.bzl", "cc_binary") + def add_sample(name): - native.cc_binary( + cc_binary( name = name, srcs = ["{}.cpp".format(name)], deps = ["//:argparse"], diff --git a/test/BUILD.bazel b/test/BUILD.bazel index f91e3a9a..c75a0c73 100644 --- a/test/BUILD.bazel +++ b/test/BUILD.bazel @@ -1,3 +1,5 @@ +load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test") + cc_library( name = "doctest", srcs = [