CMake: Simplify Interrogate.cmake's add_python_module() keyword handling

This commit is contained in:
Sam Edwards 2018-12-05 18:55:55 -07:00
parent 368cdc2802
commit 58dd889165

View File

@ -257,19 +257,16 @@ function(add_python_module module)
set(sources_abs) set(sources_abs)
set(extensions) set(extensions)
set(link_keyword OFF) set(keyword)
set(import_keyword OFF)
foreach(arg ${ARGN}) foreach(arg ${ARGN})
if(arg STREQUAL "LINK") if(arg STREQUAL "LINK" OR arg STREQUAL "IMPORT")
set(link_keyword ON) set(keyword "${arg}")
set(import_keyword OFF) elseif(keyword STREQUAL "LINK")
elseif(arg STREQUAL "IMPORT")
set(link_keyword OFF)
set(import_keyword ON)
elseif(link_keyword)
list(APPEND link_targets "${arg}") list(APPEND link_targets "${arg}")
elseif(import_keyword) set(keyword)
elseif(keyword STREQUAL "IMPORT")
list(APPEND import_flags "-import" "${arg}") list(APPEND import_flags "-import" "${arg}")
set(keyword)
else() else()
list(APPEND targets "${arg}") list(APPEND targets "${arg}")
endif() endif()