39 lines
1 KiB
CMake
39 lines
1 KiB
CMake
cmake_minimum_required(VERSION 3.21)
|
|
project(DrangPlatform VERSION 1.0.0 LANGUAGES C)
|
|
|
|
option(DRANG_PLATFORM_BUILD_SHARED "Build DrangPlatform as a shared library" OFF)
|
|
|
|
set(CMAKE_C_STANDARD 17)
|
|
set(CMAKE_C_STANDARD_REQUIRED ON)
|
|
set(CMAKE_C_EXTENSIONS OFF)
|
|
|
|
set(OUTPUT_DIR ${CMAKE_BINARY_DIR}/bin)
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_DIR})
|
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_DIR})
|
|
|
|
if(WIN32)
|
|
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
|
|
endif()
|
|
|
|
include(FetchContent)
|
|
|
|
FetchContent_Declare(
|
|
mimalloc
|
|
GIT_REPOSITORY https://pallas.t0byte.com/PallasDev/mimalloc.git
|
|
GIT_TAG main
|
|
)
|
|
|
|
set(MI_OVERRIDE OFF CACHE BOOL "" FORCE)
|
|
set(MI_BUILD_SHARED OFF CACHE BOOL "" FORCE)
|
|
set(MI_BUILD_STATIC ON CACHE BOOL "" FORCE)
|
|
set(MI_USE_CXX OFF CACHE BOOL "" FORCE)
|
|
set(MI_BUILD_TESTS OFF CACHE BOOL "" FORCE)
|
|
set(MI_BUILD_OBJECT OFF CACHE BOOL "" FORCE)
|
|
|
|
FetchContent_MakeAvailable(mimalloc)
|
|
|
|
add_subdirectory(Source/DrangPlatform)
|
|
|
|
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Playground)
|
|
add_subdirectory(Playground)
|
|
endif()
|