Update cmake to allow generation as lib or standalone

This commit is contained in:
Tilen Majerle 2021-12-24 13:21:32 +01:00
parent 62d0c40f01
commit cbc215be11
2 changed files with 2 additions and 3 deletions

View File

@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 3.0.0)
# Setup project
project(LwMEM VERSION 2.0.1)
set(LWMEM_LIB_NAME lwmem)
# ------------------------
# Configuration used if this is used as

View File

@ -16,7 +16,7 @@ endif()
add_library(${LWMEM_LIB_NAME} INTERFACE)
# Setup generic source files
target_sources(${LWMEM_LIB_NAME} INTERFACE
target_sources(${LWMEM_LIB_NAME} PUBLIC
${CMAKE_CURRENT_LIST_DIR}/src/lwmem/lwmem.c
${CMAKE_CURRENT_LIST_DIR}/src/system/lwmem_sys_${LWMEM_SYS_ARCH}.c
)
@ -24,4 +24,4 @@ target_sources(${LWMEM_LIB_NAME} INTERFACE
# Setup include directories
target_include_directories(${LWMEM_LIB_NAME} INTERFACE
${CMAKE_CURRENT_LIST_DIR}/src/include
)
)