Compare commits
11 Commits
c2a82cc76f
...
Developmen
| Author | SHA1 | Date | |
|---|---|---|---|
| 5829530652 | |||
| a062a058cd | |||
| 46b8095c6a | |||
| 63fd92c584 | |||
| 3466469440 | |||
| b5c2e4936b | |||
| 02a08012d0 | |||
| 3d4394765b | |||
| 063645fae3 | |||
| 6c8979684d | |||
| 245867da3b |
@@ -15,7 +15,6 @@ Checks: >
|
||||
-cppcoreguidelines-macro-usage,
|
||||
-cppcoreguidelines-avoid-do-while
|
||||
|
||||
HeaderFilterRegex: '^(Bigfoot)/'
|
||||
ExcludeHeaderFilterRegex: '_generated.*'
|
||||
|
||||
CheckOptions:
|
||||
|
||||
@@ -3,8 +3,8 @@ name: Bigfoot
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '**'
|
||||
workflow_dispatch:
|
||||
- main
|
||||
- Development
|
||||
|
||||
jobs:
|
||||
build-and-test:
|
||||
@@ -20,18 +20,28 @@ jobs:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
submodules: recursive
|
||||
|
||||
- name: Generate
|
||||
run: |
|
||||
conan install . --deployer=full_deploy --deployer-folder=build --remote=bigfootpackages -pr:h=clang -pr:b=clang --build=missing -s build_type=Debug -o bigfoot/*:build_tests=True -o bigfoot/*:tracy=False -o bigfoot/*:build_tools=True -o bigfoot/*:vulkan=True -o bigfoot/*:build_benchmarks=True
|
||||
cmake -S . -B ./build/Debug --toolchain ./build/Debug/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_UNITY_BUILD=Debug -G "Ninja"
|
||||
conan install . --deployer=full_deploy --deployer-folder=build --remote=bigfootpackages -pr:h=clang_coverage -pr:b=clang_coverage --build=missing -s build_type=Debug -o bigfoot/*:build_tests=True -o bigfoot/*:tracy=False -o bigfoot/*:build_tools=True -o bigfoot/*:vulkan=True -o bigfoot/*:build_benchmarks=True
|
||||
cmake -S . -B ./build/Debug --toolchain ./build/Debug/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Debug -G "Ninja"
|
||||
cmake --build build/Debug --parallel $(nproc)
|
||||
|
||||
- name: Clang-Tidy
|
||||
run: run-clang-tidy -p ./build/Debug/ >> tidy_result
|
||||
run: run-clang-tidy -p ./build/Debug/ >> tidy_result.txt
|
||||
|
||||
- name: Infer
|
||||
run: infer run --compilation-database build/Debug/compile_commands.json
|
||||
|
||||
- name: SonarQube Scan
|
||||
if: github.head_ref == 'main' || github.ref_name == 'main'
|
||||
uses: SonarSource/sonarqube-scan-action@v7.0.0
|
||||
with:
|
||||
args: >
|
||||
-Dsonar.cxx.jsonCompilationDatabase=./build/Debug/compile_commands.json
|
||||
-Dsonar.verbose=true
|
||||
env:
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
SONAR_HOST_URL: ${{ secrets.SONAR_HOST }}
|
||||
3
.inferconfig
Normal file
3
.inferconfig
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
|
||||
}
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
#include <EASTL/array.h>
|
||||
#include <EASTL/bit.h>
|
||||
#include <EASTL/optional.h>
|
||||
#include <EASTL/type_traits.h>
|
||||
#include <EASTL/utility.h>
|
||||
|
||||
@@ -32,7 +33,7 @@ class Singleton
|
||||
*/
|
||||
static constexpr TYPE& Instance()
|
||||
{
|
||||
return *eastl::bit_cast<TYPE*>(ms_instance.data());
|
||||
return ms_instance.value();
|
||||
}
|
||||
|
||||
class Lifetime
|
||||
@@ -78,9 +79,7 @@ class Singleton
|
||||
template<typename... ARGS>
|
||||
static void Initialize(ARGS&&... p_args)
|
||||
{
|
||||
new (ms_instance.data()) TYPE(eastl::forward<ARGS>(p_args)...);
|
||||
|
||||
ms_initialized = true;
|
||||
ms_instance.emplace(eastl::forward<ARGS>(p_args)...);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -89,20 +88,13 @@ class Singleton
|
||||
*/
|
||||
static void Finalize()
|
||||
{
|
||||
eastl::bit_cast<TYPE*>(ms_instance.data())->~TYPE();
|
||||
|
||||
ms_initialized = false;
|
||||
ms_instance.reset();
|
||||
}
|
||||
|
||||
/**
|
||||
* The singleton.
|
||||
*/
|
||||
alignas(alignof(TYPE)) inline static eastl::array<std::byte, sizeof(TYPE)> ms_instance;
|
||||
|
||||
/**
|
||||
* Is the singleton initialized?
|
||||
*/
|
||||
inline static bool ms_initialized = false;
|
||||
inline static eastl::optional<TYPE> ms_instance;
|
||||
};
|
||||
} // namespace Bigfoot
|
||||
#endif
|
||||
|
||||
@@ -22,6 +22,8 @@ function(bigfoot_create_package_lib PackagePublicDependencies PackagePrivateDepe
|
||||
${_BF_SOURCES}
|
||||
)
|
||||
|
||||
target_compile_options(${PROJECT_NAME} PRIVATE ${BIGFOOT_CXX_FLAGS})
|
||||
|
||||
target_link_libraries(${PROJECT_NAME} PUBLIC unordered_dense::unordered_dense EASTL::EASTL flatbuffers::flatbuffers rapidhash::rapidhash)
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE ${CMAKE_DL_LIBS})
|
||||
|
||||
@@ -55,6 +57,9 @@ function(bigfoot_create_package_tests ParentFolder BigfootDependencies)
|
||||
${_BF_TEST_SOURCES}
|
||||
)
|
||||
|
||||
target_compile_options(${PROJECT_NAME} PRIVATE ${BIGFOOT_CXX_FLAGS})
|
||||
target_link_options(${PROJECT_NAME} PRIVATE ${BIGFOOT_EXE_LINK_FLAGS})
|
||||
|
||||
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/Include)
|
||||
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE $<LINK_LIBRARY:WHOLE_ARCHIVE,${PackageName}>)
|
||||
@@ -89,5 +94,4 @@ function(bigfoot_create_package_tests ParentFolder BigfootDependencies)
|
||||
add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}Fixture)
|
||||
|
||||
set_target_properties(${PROJECT_NAME}Fixture PROPERTIES FOLDER UtilityTargets/Tests/Bigfoot/${ParentFolder})
|
||||
|
||||
endfunction()
|
||||
@@ -1,5 +1,6 @@
|
||||
cmake_minimum_required(VERSION 3.24)
|
||||
|
||||
# CMake sets this flag by default, we don't use exception in bigfoot, we can remove it
|
||||
string(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
|
||||
project(Bigfoot VERSION 0.1.0
|
||||
|
||||
@@ -8,4 +8,7 @@ sonar.sources=Bigfoot/Sources
|
||||
sonar.tests=Bigfoot/Tests
|
||||
|
||||
sonar.cxx.file.suffixes=.hpp,.cpp,.h
|
||||
sonar.cxx.clangtidy.reportPaths=tidy_result
|
||||
sonar.cxx.clangtidy.reportPaths=tidy_result.txt
|
||||
sonar.cxx.infer.reportPaths=infer-out/report.json
|
||||
|
||||
sonar.cxx.jsonCompilationDatabase.analyzeOnlyContainedFiles=True
|
||||
|
||||
Reference in New Issue
Block a user