Skip to content

Commit

Permalink
Add Mimalloc to submodules
Browse files Browse the repository at this point in the history
  • Loading branch information
JailbreakPapa committed Apr 27, 2024
1 parent f30d58a commit bfb88bc
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "Code/ThirdParty/mimalloc"]
path = Code/ThirdParty/mimalloc
url = https://github.com/microsoft/mimalloc.git
30 changes: 13 additions & 17 deletions Code/Foundation/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ns_cmake_init()

# Get the name of this folder as the project name
get_filename_component(PROJECT_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME_WE )
get_filename_component(PROJECT_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME_WE)

ns_create_target(LIBRARY ${PROJECT_NAME} NO_NS_PREFIX)

Expand All @@ -15,12 +15,13 @@ endif()

ns_enable_strict_warnings(${PROJECT_NAME})

if (NS_CMAKE_PLATFORM_LINUX)
if(NS_CMAKE_PLATFORM_LINUX)
CHECK_INCLUDE_FILE_CXX("uuid/uuid.h" UUID_HEADER)
if (NOT UUID_HEADER)

if(NOT UUID_HEADER)
message(FATAL_ERROR "Missing uuid/uuid.h. Have you installed the uuid-dev package?")
endif()

target_link_libraries(${PROJECT_NAME}
PRIVATE

Expand All @@ -29,7 +30,7 @@ if (NS_CMAKE_PLATFORM_LINUX)
)
endif()

if (CURRENT_OSX_VERSION)
if(CURRENT_OSX_VERSION)
find_library(CORESERVICES_LIBRARY CoreServices)
find_library(COREFOUNDATION_LIBRARY CoreFoundation)

Expand All @@ -43,30 +44,25 @@ if (CURRENT_OSX_VERSION)
)
endif()


if (NS_3RDPARTY_ENET_SUPPORT)

if(NS_3RDPARTY_ENET_SUPPORT)
target_link_libraries(${PROJECT_NAME} PUBLIC enet)

endif()

if (NS_3RDPARTY_ZSTD_SUPPORT)

if(NS_3RDPARTY_ZSTD_SUPPORT)
target_link_libraries(${PROJECT_NAME} PUBLIC zstd)

endif()


if(NS_3RDPARTY_GLFW_SUPPORT)

target_compile_definitions(${PROJECT_NAME} PUBLIC BUILDSYSTEM_ENABLE_GLFW_SUPPORT)
target_link_libraries(${PROJECT_NAME} PRIVATE glfw)
endif()

if(NS_3RDPARY_MIMALLOC_SUPPORT)
# Add MIMalloc
target_link_libraries(${PROJECT_NAME} PRIVATE mimalloc)
endif()

set_target_properties(${PROJECT_NAME}
PROPERTIES
PROPERTIES
OUTPUT_NAME "wdcorestdlib"
)


2 changes: 1 addition & 1 deletion Code/Foundation/Configuration/PlatformSubsystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

#include <Foundation/Basics.h>
#include <Foundation/Utilities/EnumerableClass.h>

#include <Foundation/Configuration/SubSystem.h>

/// NOTE: THIS IS NOT ALLOWED TO BE INCLUDED IN THE OPEN-SOURCE VERSION.
/// @brief Base class for implementing functionality for extra platforms (Consoles).
/// see nsSubSystem for more info.
Expand Down
1 change: 1 addition & 0 deletions nsCMakeConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ set_property(GLOBAL PROPERTY NS_CONFIG_QT_WINX64_URL "https://github.com/ezEngin
set_property(GLOBAL PROPERTY NS_CONFIG_VULKAN_SDK_LINUXX64_VERSION "1.3.216.0")
set_property(GLOBAL PROPERTY NS_CONFIG_VULKAN_SDK_LINUXX64_URL "https://sdk.lunarg.com/sdk/download/1.3.216.0/linux/vulkansdk-linux-x86_64-1.3.216.0.tar.gz")

set_property(GLOBAL PROPERTY NS_3RDPARTY_MIMALLOC_SUPPORT CACHE BOOL ON "Enable Support for MiMalloc")

0 comments on commit bfb88bc

Please sign in to comment.