From 756a7bce1dc4a03b35fc5e7e6d34b1ad14308b37 Mon Sep 17 00:00:00 2001 From: Tilen M Date: Tue, 3 Sep 2024 21:42:01 +0200 Subject: [PATCH] Update CMake to expose lib as PUBLIC/PRIVATE and not INTERFACE --- CHANGELOG.md | 2 ++ lwmem/library.cmake | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4133354..b3d10c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Develop +- Rework library CMake with removed INTERFACE type + ## v2.1.0 - Split CMakeLists.txt files between library and executable diff --git a/lwmem/library.cmake b/lwmem/library.cmake index 2917049..a8cde02 100644 --- a/lwmem/library.cmake +++ b/lwmem/library.cmake @@ -39,16 +39,16 @@ set(lwmem_core_SRCS ${lwmem_core_SRCS} endif() # Register core library -add_library(lwmem INTERFACE) -target_sources(lwmem PUBLIC ${lwmem_core_SRCS}) -target_include_directories(lwmem INTERFACE ${lwmem_include_DIRS}) +add_library(lwmem) +target_sources(lwmem PRIVATE ${lwmem_core_SRCS}) +target_include_directories(lwmem PUBLIC ${lwmem_include_DIRS}) target_compile_options(lwmem PRIVATE ${LWMEM_COMPILE_OPTIONS}) target_compile_definitions(lwmem PRIVATE ${LWMEM_COMPILE_DEFINITIONS}) # Register core library with C++ extensions -add_library(lwmem_cpp INTERFACE) -target_sources(lwmem_cpp PUBLIC ${lwmem_core_SRCS}) -target_include_directories(lwmem_cpp INTERFACE ${lwmem_include_DIRS}) +add_library(lwmem_cpp) +target_sources(lwmem_cpp PRIVATE ${lwmem_core_SRCS}) +target_include_directories(lwmem_cpp PUBLIC ${lwmem_include_DIRS}) target_compile_options(lwmem_cpp PRIVATE ${LWMEM_COMPILE_OPTIONS}) target_compile_definitions(lwmem_cpp PRIVATE ${LWMEM_COMPILE_DEFINITIONS})