Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v1.7 #38

Open
wants to merge 47 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
066b806
Fixes for Unreal Engine, removed TChar
muit Aug 7, 2024
799dba2
Missed fixed for Unreal Engine
muit Aug 7, 2024
9b21a80
Fix cast
muit Aug 7, 2024
42bab5e
Added custom loggers
muit Aug 8, 2024
cd0d0c5
Only expose public extern headers
muit Aug 14, 2024
4057c48
[FORMAT] Inject braces
muit Aug 16, 2024
59f7b60
Small Debug improvements
muit Aug 17, 2024
2b296c0
Fix ToPackedRGBA in RBGA colors
muit Aug 18, 2024
b0e44c7
Small format changes
muit Aug 19, 2024
4214792
Separated Export.h from CMake
muit Aug 22, 2024
1d4ad4a
Added Frac()
muit Sep 10, 2024
a9531c4
Merge branch 'feature/unreal-inline-compilation' into release/v1.7
muit Oct 15, 2024
bc72c82
Fixes for 1.7 merge
muit Oct 16, 2024
25b56b0
Only export symbols on Windows
muit Oct 16, 2024
dd52eaf
[CICD] Updated cicd compilers
muit Oct 17, 2024
b7bef32
[CICD] Removed MacOS exclusion
muit Oct 17, 2024
75a8453
Only include Windows in Windows
muit Oct 17, 2024
53017c2
Small fixes: Use relative yyjson include
muit Oct 17, 2024
3a991f1
[CICD] Cleaned matrix
muit Oct 17, 2024
73cdd04
Small fixes
muit Oct 17, 2024
f2aad85
[CICD] Exclude build configs
muit Oct 17, 2024
5af3fac
Fix invalid asm check on MacOS
muit Oct 17, 2024
580a99c
Refactored Platform Breaks
muit Oct 17, 2024
ae7f281
Fix PlatformBreak on MacOS GCC
muit Oct 17, 2024
dd61721
PIPE_API changes
muit Oct 17, 2024
f37295f
Add C to languages of CMake Project
muit Oct 17, 2024
fe3d4db
Added Casteable Interface, removed requirement for rtti
muit Nov 28, 2024
4b490db
Fix inline on some platform for PlatformBreak
muit Nov 28, 2024
46eaa6d
Improved OwnPtr casting
muit Nov 28, 2024
1d06d1a
Missed change
muit Nov 28, 2024
e7482b3
Unified platform headers
muit Dec 1, 2024
3162904
Cast improvements, Reader & Writers are casteable
muit Dec 1, 2024
70e3dba
Misspelling fix
muit Dec 1, 2024
44ef11f
Removed PlatformMisc files
muit Dec 1, 2024
a1dfa20
Merged Arenas & Memory into core headers
muit Dec 3, 2024
3c1632f
Removed Memory.h
muit Dec 3, 2024
08b0d22
Fixed create with owner test
muit Dec 6, 2024
c6e3794
Merge commit '08b0d22eac529307b2368a0a7a841936705d4209' into release/…
muit Dec 6, 2024
9bb9c3e
[CICD] Use clang 18
muit Dec 6, 2024
83d58b7
Disable Clang on MacOS due to unrelated link errors
muit Dec 6, 2024
70be723
Merged BLocks and STLAllocator into PipeMemory
muit Dec 6, 2024
747ffec
Moved NewDelete
muit Dec 6, 2024
f4800f4
Missing changes
muit Dec 6, 2024
ff33f77
Disabled RTTI
muit Dec 8, 2024
d79e4fa
Removed WCHAR support from SetCurrentPath
muit Dec 14, 2024
175b934
Removed Backward library
muit Dec 14, 2024
a7da134
Missing change
muit Dec 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ BinPackArguments: true
BinPackParameters: true
BitFieldColonSpacing: None
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeBraces: Custom
BreakBeforeConceptDeclarations: true
BreakConstructorInitializers: BeforeComma
BreakInheritanceList: AfterComma
Expand Down Expand Up @@ -62,6 +61,7 @@ IndentPPDirectives: BeforeHash
IndentRequires: true
IndentWidth: 4
IndentWrappedFunctionNames: false
InsertBraces: true
KeepEmptyLinesAtTheStartOfBlocks: false
LambdaBodyIndentation: OuterScope
MaxEmptyLinesToKeep: 2
Expand Down
54 changes: 26 additions & 28 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,31 @@ on:

jobs:
Build:
name: ${{ matrix.os-name }} (${{ matrix.compiler }}, ${{ matrix.config }})
name: ${{ matrix.os }} (${{ matrix.compiler }}, ${{ matrix.config }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
config: [Release, Debug]
name: [windows-msvc, windows-clang, linux-clang, linux-gcc, macos-clang]
include:
- name: windows-msvc
os: windows-latest
os-name: Windows
os:
- windows-2022
- ubuntu-24.04
- macos-15
compiler:
- clang-18
- gcc-14
- msvc
exclude:
- os: windows-2022
compiler: gcc-14
- os: ubuntu-24.04
compiler: msvc
- name: windows-clang
os: windows-latest
os-name: Windows
compiler: clang-17
- name: linux-clang
os: ubuntu-latest
os-name: Linux
compiler: clang-16
- name: linux-gcc
os: ubuntu-latest
os-name: Linux
compiler: gcc-13
- name: macos-clang
os: macos-14
os-name: MacOS
compiler: clang-17
- os: macos-15
compiler: msvc
- os: macos-15
compiler: clang-18
env:
os-name: ${{ contains(matrix.os, 'windows') && 'Windows' || (contains(matrix.os, 'ubuntu') && 'Linux' || 'MacOS') }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -49,13 +46,14 @@ jobs:
- name: Setup Cpp
uses: aminya/setup-cpp@v1
with:
compiler: ${{ (matrix.os-name != 'MacOS' || !contains(matrix.compiler, 'clang')) && matrix.compiler || '' }}
vcvarsall: ${{ matrix.os-name == 'Windows' }}
# Skip compiler setup for macos clang-17
compiler: ${{ (contains(matrix.os, 'macos') && matrix.compiler == 'clang-17') && '' || matrix.compiler }}
vcvarsall: ${{ contains(matrix.os, 'windows') }}
cmake: true
ninja: true

- name: (MacOS) Install clang through brew
if: matrix.os-name == 'MacOS' && contains(matrix.compiler, 'clang')
- name: (MacOS) Install clang-17 through brew
if: contains(matrix.os, 'macos') && matrix.compiler == 'clang-17'
run: |
brew install llvm@17
export LLVM_DIR="$(brew --prefix llvm@17)/lib/cmake"
Expand Down Expand Up @@ -83,11 +81,11 @@ jobs:
uses: actions/upload-artifact@v4
if: ${{ contains(matrix.compiler, 'clang') }} # Only clang artifacts are stored
with:
name: Pipe-${{ matrix.os-name }}-${{ matrix.config }}
name: Pipe-${{ env.os-name }}-${{ matrix.config }}
path: Install

- name: Run Tests
if: ${{ matrix.os-name != 'macos' }} # Tests are skipped temporarily on MacOS
if: ${{ !contains(matrix.os, 'macos') }} # Tests are skipped temporarily on MacOS
working-directory: ./Build
run: ctest --output-on-failure -j2 -C ${{ matrix.config }}

Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,3 @@ Saved
/compile_commands.json
compile_commands.json
Install

Include/Pipe/Export.h
7 changes: 1 addition & 6 deletions Benchmarks/Arenas.bench.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@
#include "nanobench.h"
using namespace ankerl;

#include <Pipe/Memory/Alloc.h>
#include <Pipe/Memory/BestFitArena.h>
#include <Pipe/Memory/BigBestFitArena.h>
#include <Pipe/Memory/HeapArena.h>
#include <Pipe/Memory/MonoLinearArena.h>
#include <Pipe/Memory/MultiLinearArena.h>
#include <PipeMemoryArenas.h>
#include <PipeTime.h>


Expand Down
2 changes: 1 addition & 1 deletion Benchmarks/main.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2015-2024 Piperift - All rights reserved

#include <Pipe/Memory/NewDelete.h>
#include <PipeNewDelete.h>
// Override as first include

#define ANKERL_NANOBENCH_IMPLEMENT 1
Expand Down
24 changes: 16 additions & 8 deletions CMake/Util.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,23 @@ function(set_option target exposure option)
endfunction()

function(target_add_link_option_if_compiles target exposure flag)
CHECK_CXX_COMPILER_FLAG("${flag}" COMPILER_HAS_THOSE_TOGGLES)
if(COMPILER_HAS_THOSE_TOGGLES)
target_link_options(${target_name} ${exposure} ${flag})
endif()
CHECK_CXX_COMPILER_FLAG("${flag}" COMPILER_HAS_THOSE_TOGGLES)
if(COMPILER_HAS_THOSE_TOGGLES)
target_link_options(${target_name} ${exposure} ${flag})
endif()
endfunction()

function(target_add_compile_option_if_compiles target exposure flag)
CHECK_CXX_COMPILER_FLAG("${flag}" COMPILER_HAS_THOSE_TOGGLES)
if(COMPILER_HAS_THOSE_TOGGLES)
target_compile_options(${target_name} ${exposure} ${flag})
endif()
CHECK_CXX_COMPILER_FLAG("${flag}" COMPILER_HAS_THOSE_TOGGLES)
if(COMPILER_HAS_THOSE_TOGGLES)
target_compile_options(${target_name} ${exposure} ${flag})
endif()
endfunction()

function(pipe_target_disable_rtti target exposure)
if(COMPILER_MSVC)
target_compile_options(${target} ${exposure} /GR-)
elseif(COMPILER_CLANG OR COMPILER_GCC)
target_compile_options(${target} ${exposure} -fno-rtti)
endif()
endfunction()
15 changes: 7 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
################################################################################
# Project

project(Pipe VERSION 0.1 LANGUAGES CXX)
project(Pipe VERSION 0.1 LANGUAGES CXX C)


if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
Expand All @@ -38,7 +38,6 @@ endif()
include(CMake/Util.cmake)
include(CMake/LinkTimeOptimization.cmake)
find_package(Sanitizers)
include(GenerateExportHeader)


# ##############################################################################
Expand All @@ -52,18 +51,17 @@ add_subdirectory(Extern)

if (PIPE_BUILD_SHARED)
add_library(Pipe SHARED)
target_compile_definitions(Pipe PUBLIC PIPE_IMPORTS=1)
target_compile_definitions(Pipe PRIVATE -DPIPE_IMPORTS PIPE_EXPORTS=1)
else()
add_library(Pipe STATIC)
endif()

generate_export_header(Pipe
BASE_NAME PIPE
EXPORT_MACRO_NAME PIPE_API
EXPORT_FILE_NAME ${CMAKE_CURRENT_SOURCE_DIR}/Include/Pipe/Export.h)
pipe_target_define_platform(Pipe)

target_include_directories(Pipe PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/Include>)
file(GLOB_RECURSE PIPE_SOURCE_FILES CONFIGURE_DEPENDS Src/*.cpp Src/*.h)
target_include_directories(Pipe PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/Src>)
file(GLOB_RECURSE PIPE_SOURCE_FILES CONFIGURE_DEPENDS Src/*.cpp Src/*.c)
target_sources(Pipe PRIVATE ${PIPE_SOURCE_FILES})
target_compile_definitions(Pipe PRIVATE NOMINMAX)

Expand All @@ -75,6 +73,7 @@ pipe_target_enable_CPP20(Pipe)
pipe_add_sanitizers(Pipe)
pipe_target_shared_output_directory(Pipe)
#pipe_target_link_time_optimization(Pipe)
pipe_target_disable_rtti(Pipe PRIVATE)


################################################################################
Expand Down Expand Up @@ -130,6 +129,6 @@ install(DIRECTORY Include/Pipe
)

# Debug files
if (PLATFORM_WINDOWS)
if (PLATFORM_WINDOWS AND NOT COMPILER_GCC)
install(FILES $<TARGET_PDB_FILE:Pipe> DESTINATION "${CMAKE_INSTALL_LIBDIR}" OPTIONAL)
endif()
16 changes: 14 additions & 2 deletions Include/Misc/PipeDebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ static_assert(false, "Imgui not found. PipeDebug requires v1.90 or newer.");
static_assert(false, "Imgui v" IMGUI_VERSION " found but PipeDebug requires v1.90 or newer.");
#endif

// Mark debug tools as present for others
#define P_DEBUG_TOOLS 1

#include "Misc/PipeImGui.h"
#include "Pipe/Core/Checks.h"
Expand Down Expand Up @@ -176,7 +178,8 @@ namespace p

EntityContext* ctx = nullptr;

bool initialized = false;
bool initialized = false;
bool isFirstDebug = true;


DebugContext() = default;
Expand Down Expand Up @@ -871,9 +874,13 @@ namespace p
ImGui::PushTextColor(errorTextColor);
const char* errorMsg;
if (inspector.id == NoId)
{
errorMsg = "No entity";
}
else
{
errorMsg = removed ? "Removed entity" : "Invalid entity";
}

auto regionAvail = ImGui::GetContentRegionAvail();
auto textSize =
Expand Down Expand Up @@ -1139,7 +1146,9 @@ namespace p

ImGui::TableSetColumnIndex(0); // Id
if (!passedFilter)
{
ImGui::PushTextColor(ImGui::GetTextColor().Shade(0.3f));
}
ImGuiTreeNodeFlags treeNodeFlags =
ImGuiTreeNodeFlags_SpanAllColumns | ImGuiTreeNodeFlags_NoTreePushOnOpen;
if (typeProperties.IsEmpty())
Expand All @@ -1148,7 +1157,9 @@ namespace p
}
const bool propsOpen = ImGui::TreeNodeEx(idText.data(), treeNodeFlags);
if (!passedFilter)
{
ImGui::PopTextColor();
}

ImGui::TableSetColumnIndex(1); // Name
StringView ns;
Expand Down Expand Up @@ -1277,7 +1288,8 @@ namespace p
"Called EndDebug() but there was no current ECS Debug Context! Forgot "
"to call "
"BeginDebug()?");
currentContext = nullptr;
currentContext->isFirstDebug = false;
currentContext = nullptr;
}
#endif
}; // namespace p
4 changes: 2 additions & 2 deletions Include/Pipe.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@

namespace p
{
PIPE_API void Initialize(StringView logPath = {});
PIPE_API void Shutdown();
PIPE_API void Initialize(struct Logger* logger = nullptr);
PIPE_API void Shutdown();
}; // namespace p
Loading
Loading