Make linking psemek-backend optional
This commit is contained in:
parent
ceb69b9d62
commit
a1b00d4a70
1 changed files with 13 additions and 2 deletions
|
|
@ -31,11 +31,14 @@ function(psemek_package_output_path target outvar)
|
|||
set(${outvar} "${CMAKE_CURRENT_LIST_DIR}/${PSEMEK_PACKAGE_OUTPUT_PATH}/${target}${PSEMEK_PACKAGE_VERSION_SUFFIX}-${PSEMEK_PACKAGE_SUFFIX}.zip" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(psemek_add_executable target)
|
||||
function(psemek_add_executable_impl target link_backend)
|
||||
if((NOT PSEMEK_PACKAGE_MODE) OR PSEMEK_PACKAGE_TARGET)
|
||||
add_executable(${target} ${ARGN})
|
||||
|
||||
target_link_libraries(${target} PUBLIC psemek psemek-backend)
|
||||
target_link_libraries(${target} PUBLIC psemek)
|
||||
if(${link_backend})
|
||||
target_link_libraries(${target} PUBLIC psemek-backend)
|
||||
endif()
|
||||
|
||||
if(PSEMEK_PACKAGE_MODE)
|
||||
target_link_options(${target} PUBLIC ${PSEMEK_PACKAGE_LINK_FLAGS})
|
||||
|
|
@ -68,6 +71,14 @@ function(psemek_add_executable target)
|
|||
endif()
|
||||
endfunction()
|
||||
|
||||
function(psemek_add_executable target)
|
||||
psemek_add_executable_impl(${target} FALSE ${ARGN})
|
||||
endfunction()
|
||||
|
||||
function(psemek_add_application target)
|
||||
psemek_add_executable_impl(${target} TRUE ${ARGN})
|
||||
endfunction()
|
||||
|
||||
function(psemek_add_build_tool target link_psemek)
|
||||
if((NOT PSEMEK_PACKAGE_MODE) OR PSEMEK_PACKAGE_HOST)
|
||||
add_executable(${target} ${ARGN})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue