1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-05 16:43:52 +01:00

Fix CMake build of modules

They must not be linked against any libraries as build time.  The
symbols will be resovled at runtime.
This commit is contained in:
Leland Lucius
2020-05-11 15:07:51 -05:00
committed by James Crook
parent c33a75ee25
commit 93fd83c58c
4 changed files with 53 additions and 14 deletions

View File

@@ -14,11 +14,13 @@ list( APPEND SOURCES
${TARGET_ROOT}/ScripterCallback.cpp
)
get_target_property( INCLUDES wxWidgets INTERFACE_INCLUDE_DIRECTORIES )
list( APPEND INCLUDES
PUBLIC
${TARGET_ROOT}
)
get_target_property( DEFINES wxWidgets INTERFACE_COMPILE_DEFINITIONS )
list( APPEND DEFINES
PRIVATE
BUILDING_SCRIPT_PIPE
@@ -31,10 +33,14 @@ list( APPEND DEFINES
wxDEBUG_LEVEL=0
)
list( APPEND LOPTS
PRIVATE
$<$<PLATFORM_ID:Darwin>:-undefined dynamic_lookup>
)
list( APPEND LIBRARIES
PRIVATE
Audacity
wxWidgets
)
set_target_property_all( ${TARGET} LIBRARY_OUTPUT_DIRECTORY "${_DEST}/modules" )
@@ -48,5 +54,6 @@ organize_source( "${TARGET_ROOT}" "" "${SOURCES}" )
target_sources( ${TARGET} PRIVATE ${SOURCES} )
target_compile_definitions( ${TARGET} PRIVATE ${DEFINES} )
target_include_directories( ${TARGET} PRIVATE ${INCLUDES} )
target_link_options( ${TARGET} PRIVATE ${LOPTS} )
target_link_libraries( ${TARGET} PRIVATE ${LIBRARIES} )