From: user Date: Tue, 14 Jan 2020 17:42:02 +0000 (+0100) Subject: cmake: avoid redundant source list in Android lib vs executable check X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=c243364c4636813972203712bccc21d96db1ae73;p=pulseview.git 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. --- 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})