mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-18 17:10:05 +02:00
Each module defines an interface target that other modules may use...
... Solving some problems of linking modules dependent on other modules in Unix
This commit is contained in:
parent
ee344aa6c9
commit
3943d1479f
@ -221,7 +221,12 @@ function( audacity_module NAME SOURCES IMPORT_TARGETS
|
|||||||
|
|
||||||
def_vars()
|
def_vars()
|
||||||
|
|
||||||
add_library( ${TARGET} MODULE )
|
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||||
|
set( LIBTYPE SHARED )
|
||||||
|
else()
|
||||||
|
set( LIBTYPE MODULE )
|
||||||
|
endif()
|
||||||
|
add_library( ${TARGET} ${LIBTYPE} )
|
||||||
|
|
||||||
set( LOPTS
|
set( LOPTS
|
||||||
PRIVATE
|
PRIVATE
|
||||||
@ -250,4 +255,20 @@ function( audacity_module NAME SOURCES IMPORT_TARGETS
|
|||||||
target_include_directories( ${TARGET} PUBLIC ${TARGET_ROOT} )
|
target_include_directories( ${TARGET} PUBLIC ${TARGET_ROOT} )
|
||||||
target_link_options( ${TARGET} PRIVATE ${LOPTS} )
|
target_link_options( ${TARGET} PRIVATE ${LOPTS} )
|
||||||
target_link_libraries( ${TARGET} PUBLIC ${LIBRARIES} )
|
target_link_libraries( ${TARGET} PUBLIC ${LIBRARIES} )
|
||||||
|
|
||||||
|
# define an additional interface library target
|
||||||
|
set(INTERFACE_TARGET "${TARGET}-interface")
|
||||||
|
if (CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||||
|
add_library("${INTERFACE_TARGET}" ALIAS "${TARGET}")
|
||||||
|
else()
|
||||||
|
add_library("${INTERFACE_TARGET}" INTERFACE)
|
||||||
|
foreach(PROP INTERFACE_INCLUDE_DIRECTORIES INTERFACE_COMPILE_DEFINITIONS)
|
||||||
|
get_target_property( PROPS "${TARGET}" "${PROP}" )
|
||||||
|
if (PROPS)
|
||||||
|
set_target_properties(
|
||||||
|
"${INTERFACE_TARGET}"
|
||||||
|
PROPERTIES "${PROP}" "${PROPS}" )
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user