Skip to content

Commit

Permalink
Split the sanitize from the warning and platform
Browse files Browse the repository at this point in the history
  • Loading branch information
baconpaul committed Sep 11, 2023
1 parent 46f12ba commit c41fd9d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cmake/enable_sdks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@ endif()


add_library(clap-wrapper-compile-options INTERFACE)
add_library(clap-wrapper-sanitizer-options INTERFACE)

target_compile_options(clap-wrapper-compile-options INTERFACE -D${CLAP_WRAPPER_PLATFORM}=1)
if (APPLE)
target_link_libraries(clap-wrapper-compile-options INTERFACE macos_filesystem_support)
Expand All @@ -258,8 +260,9 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU")
target_compile_options(clap-wrapper-compile-options INTERFACE -Wall -Wextra -Wno-unused-parameter -Wpedantic -Werror)
if (${CLAP_WRAPPER_ENABLE_ASAN})
message(STATUS "clap-wrapper: enabling asan build")
target_compile_options(clap-wrapper-compile-options INTERFACE -fsanitize=address -fsanitize=undefined)
target_link_options(clap-wrapper-compile-options INTERFACE -fsanitize=address -fsanitize=undefined)
target_compile_options(clap-wrapper-sanitizer-options INTERFACE -fsanitize=address -fsanitize=undefined)
target_link_options(clap-wrapper-sanitizer-options INTERFACE -fsanitize=address -fsanitize=undefined)
target_link_libraries(clap-wrapper-compile-options INTERFACE clap-wrapper-sanitizer-options)
endif()
endif()

Expand Down Expand Up @@ -308,6 +311,7 @@ function(target_add_vst3_wrapper)
add_library(base-sdk-vst3 STATIC ${vst3sources})
target_include_directories(base-sdk-vst3 PUBLIC ${VST3_SDK_ROOT} ${VST3_SDK_ROOT}/public.sdk ${VST3_SDK_ROOT}/pluginterfaces)
target_compile_options(base-sdk-vst3 PUBLIC $<IF:$<CONFIG:Debug>,-DDEVELOPMENT=1,-DRELEASE=1>) # work through steinbergs alternate choices for these
target_link_libraries(base-sdk-vst3 PUBLIC clap-wrapper-sanitizer-options)
# The VST3SDK uses sprintf, not snprintf, which macOS flags as deprecated
# to move people to snprintf. Silence that warning on the VST3 build
if (APPLE)
Expand Down

0 comments on commit c41fd9d

Please sign in to comment.