Fix sanitizer linkage within veal and cmt libraries

I suspect that our sanitizer flags were removed for these two CMake
targets. Instead of setting the properties directly, we call
target_compile_options and target_link_options
instead.
This commit is contained in:
sakertooth
2023-09-03 16:58:39 -04:00
parent df77e2fa06
commit b04dce8d8c
2 changed files with 4 additions and 4 deletions

View File

@@ -38,7 +38,7 @@ SET(INLINE_FLAGS "")
IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
SET(INLINE_FLAGS "-finline-functions-called-once -finline-limit=80")
ENDIF()
SET_TARGET_PROPERTIES(veal PROPERTIES COMPILE_FLAGS "-fexceptions -O2 -finline-functions ${INLINE_FLAGS}")
target_compile_options(veal PRIVATE -fexceptions -O2 -finline-functions ${INLINE_FLAGS})
if(LMMS_BUILD_WIN32)
add_custom_command(
@@ -50,5 +50,5 @@ if(LMMS_BUILD_WIN32)
)
endif()
IF(NOT LMMS_BUILD_APPLE AND NOT LMMS_BUILD_OPENBSD)
SET_TARGET_PROPERTIES(veal PROPERTIES LINK_FLAGS "${LINK_FLAGS} -shared -Wl,-no-undefined")
target_link_options(veal PRIVATE -shared -Wl,$<IF:$<PLATFORM_ID:GNU>,-no-undefined,-undefined>)
ENDIF()

View File

@@ -5,7 +5,7 @@ ADD_LIBRARY(cmt MODULE ${SOURCES})
INSTALL(TARGETS cmt LIBRARY DESTINATION "${PLUGIN_DIR}/ladspa")
SET_TARGET_PROPERTIES(cmt PROPERTIES PREFIX "")
SET_TARGET_PROPERTIES(cmt PROPERTIES COMPILE_FLAGS "-Wall -O3 -fno-strict-aliasing")
target_compile_options(cmt PRIVATE -Wall -O3 -fno-strict-aliasing)
if(LMMS_BUILD_WIN32)
add_custom_command(
@@ -22,6 +22,6 @@ if(NOT LMMS_BUILD_WIN32)
endif()
IF(NOT LMMS_BUILD_APPLE AND NOT LMMS_BUILD_OPENBSD)
SET_TARGET_PROPERTIES(cmt PROPERTIES LINK_FLAGS "${LINK_FLAGS} -shared -Wl,-no-undefined")
target_link_options(cmt PRIVATE -shared -Wl,$<IF:$<PLATFORM_ID:GNU>,-no-undefined,-undefined>)
ENDIF()