adding third party libs and defining some early API headers
This commit is contained in:
1 parent
ba5f23b11e
commit
2296f68123
71 files changed
+40386
No files matched your search
@@ -0,0 +1,40 @@
|
||||
cmake_minimum_required(VERSION 3.21)
|
||||
project(regolith VERSION 0.0.1 LANGUAGES C)
|
||||
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
option(REGOLITH_BUILD_TESTS "Build tests" ON)
|
||||
option(REGOLITH_BUILD_SDL3 "Build the SDL3 backend" ON)
|
||||
|
||||
add_subdirectory(third_party)
|
||||
|
||||
add_library(regolith
|
||||
src/context.c
|
||||
src/layout_clay.c
|
||||
src/text_stb.c
|
||||
src/lua_module.c
|
||||
)
|
||||
add_library(regolith::regolith ALIAS regolith)
|
||||
|
||||
target_include_directories(regolith
|
||||
PUBLIC ${PROJECT_SOURCE_DIR}/include
|
||||
PRIVATE ${PROJECT_SOURCE_DIR}/src
|
||||
)
|
||||
target_link_libraries(regolith PUBLIC lua PRIVATE clay stb)
|
||||
target_compile_definitions(regolith PRIVATE RG_BUILD)
|
||||
target_compile_options(regolith PRIVATE
|
||||
$<$<NOT:$<C_COMPILER_ID:MSVC>>:-Wall -Wextra -Wpedantic>)
|
||||
set_target_properties(regolith PROPERTIES
|
||||
C_STANDARD 99
|
||||
C_EXTENSIONS OFF
|
||||
C_VISIBILITY_PRESET hidden
|
||||
)
|
||||
|
||||
if(REGOLITH_BUILD_SDL3 AND NOT EMSCRIPTEN)
|
||||
find_package(SDL3 REQUIRED CONFIG)
|
||||
endif()
|
||||
|
||||
if(REGOLITH_BUILD_TESTS)
|
||||
enable_testing()
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
Reference in new issue
Block a user