Skip to content

Commit

Permalink
Merge branch 'bazel_utilities_integration' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
0-Sacha committed Mar 12, 2024
2 parents 34f7bd3 + 16f69be commit 0f6e657
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 59 deletions.
6 changes: 3 additions & 3 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# .bazelrc

common --enable_bzlmod
common --show_timestamps
build --verbose_failures
test --test_output=errors
6 changes: 4 additions & 2 deletions .github/workflows/ProjectCore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ name: ProjectCore

on:
push:
branches: [ master ]
branches:
- '**'
pull_request:
branches: [ master ]
branches:
- '**'

jobs:
ubuntu-latest:
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# Bazel
# bazel
MODULE.bazel.lock
bazel-bin
bazel-out
Expand All @@ -13,6 +13,7 @@ bazel-testlogs
*.vcxproj.filters
*.vcxproj.user

# Make
Makefile
*.make

Expand All @@ -25,3 +26,5 @@ bin-int

# Asset
Asset

# Tests
41 changes: 15 additions & 26 deletions BUILD
Original file line number Diff line number Diff line change
@@ -1,32 +1,21 @@
""

load("@BazelUtilities//solutions:solutions.bzl", "solution_project_build", "solution_project_info", "ProjectType")
load("@BazelUtilities//toolchains/MinGW:MinGW.bzl", "mingw_gcc_toolchain")
load("@BazelUtilities//toolchains/MinGW:MinGW_localhost.bzl", "MinGW_gcc_localhost")
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")

load(":project.bzl", "info_ProjectCore")

MinGW_gcc_localhost()
mingw_gcc_toolchain.gen()

solution_project_build(
info = info_ProjectCore,
hdrs = glob([ "src/**/*.h", "src/**/*.impl" ]),
srcs = glob([ "src/**/*.h", "src/**/*.impl" ]) + glob([ "src/**/*.cpp" ])
)

# buildifier: disable=name-conventions
info_ProjectCoreTest = solution_project_info(
name = "ProjectCoreTest",
project_type = ProjectType.Test,
project_deps = [ info_ProjectCore ],
include_dirs = [ "Tests/" ],
copts = [ "-std=c++20" ],
linkopts = []
cc_library(
name = "ProjectCore",
srcs = glob([ "src/**/*.h", "src/**/*.cpp" ]),
hdrs = glob([ "src/**/*.h" ]),
includes = [ "src/" ],
strip_include_prefix = "src",
include_prefix = "ProjectCore",
visibility = ["//visibility:public"],
)

solution_project_build(
info = info_ProjectCoreTest,
hdrs = glob([ "Tests/**/*.h","Tests/FMT/*.h" ]),
srcs = glob([ "Tests/**/*.h","Tests/FMT/*.h" ]) + glob([ "Tests/*.cpp", "Tests/**/*.cpp" ])
cc_test(
name = "ProjectCoreTests",
includes = [ "src/" ],
srcs = glob([ "Tests/**/*.h", "Tests/**/*.cpp" ]),
deps = [ ":ProjectCore" ],
visibility = ["//visibility:public"],
)
9 changes: 1 addition & 8 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
###############################################################################
# Bazel now uses Bzlmod by default to manage external dependencies.
# Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel.
#
# For more details, please check https://github.com/bazelbuild/bazel/issues/18958
###############################################################################
""

# buildifier: disable=module-docstring
module(
name = "projectcore",
version = "0.1",
repo_name = "com_sacha_projectcore",
)

# bazel_dep(name = "bazel_skylib", version = "1.4.2")
12 changes: 6 additions & 6 deletions premake5.lua
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@

-- TODO:bazel remove Solution.Projects Infos:
Solution.Projects["ProjectCore"].PlatformDefineName = "PROJECTCORE"
Solution.Projects["ProjectCore"].Type = "StaticLib"
Solution.Projects["ProjectCore"].IncludeDirs = {
"%{Solution.Projects.ProjectCore.Path}/src/",
"%{Solution.Projects.ProjectCore.Path}/src/ProjectCore",
"%{Solution.Projects.ProjectCore.Path}/src/"
}

project "ProjectCore"
kind (Solution.Projects["ProjectCore"].Type)
language "C++"
cppdialect "C++20"
language "C++"
cppdialect "C++20"

Solution.HighWarnings()

Expand Down Expand Up @@ -42,8 +42,8 @@ Solution.Launch["ProjectCoreTests"] = ProjectCoreTestsLaunch

project "ProjectCoreTests"
kind (Solution.Projects["ProjectCoreTests"].Type)
language "C++"
cppdialect "C++20"
language "C++"
cppdialect "C++20"

Solution.HighWarnings()

Expand Down
13 changes: 0 additions & 13 deletions project.bzl

This file was deleted.

0 comments on commit 0f6e657

Please sign in to comment.