From c243364c4636813972203712bccc21d96db1ae73 Mon Sep 17 00:00:00 2001 From: user Date: Tue, 14 Jan 2020 18:42:02 +0100 Subject: [PATCH] cmake: avoid redundant source list in Android lib vs executable check Factor out a common list of input files (sources, and resources) in the conditional instructions which either build a shared object or an executable from the same list of input files. --- CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 38252fdd..5330663d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -528,10 +528,11 @@ if(ANDROID) list(APPEND PULSEVIEW_LINK_LIBS "-llog") endif() +set(INPUT_FILES_LIST ${pulseview_SOURCES} ${pulseview_RESOURCES_RCC} ${QM_FILES}) if(ANDROID) - add_library(${PROJECT_NAME} SHARED ${pulseview_SOURCES} ${pulseview_RESOURCES_RCC} ${QM_FILES}) + add_library(${PROJECT_NAME} SHARED ${INPUT_FILES_LIST}) else() - add_executable(${PROJECT_NAME} ${pulseview_SOURCES} ${pulseview_RESOURCES_RCC} ${QM_FILES}) + add_executable(${PROJECT_NAME} ${INPUT_FILES_LIST}) endif() target_link_libraries(${PROJECT_NAME} ${PULSEVIEW_LINK_LIBS}) -- 2.30.2