diff --git a/support/BuildSupport.cmake b/support/BuildSupport.cmake index 93a1ec2..16338e7 100644 --- a/support/BuildSupport.cmake +++ b/support/BuildSupport.cmake @@ -60,7 +60,7 @@ endfunction() ## LINK(list): A list containing the linker play_mode_flags function(bs_internal_select_cflags_gcc SANITIZERS COMPILE LINK) # "Who cares about ISO C anyway?" - list(APPEND _INTERNAL_FLAGS "-Wall" "-Wextra" "-Werror" "-Wshadow" "-fPIC" "-flto" "-Wno-cast-function-type") + list(APPEND _INTERNAL_FLAGS "-Wall" "-Wextra" "-Werror" "-Wshadow" "-fPIC" "-Wno-cast-function-type") if (CMAKE_BUILD_TYPE MATCHES "^Debug" AND ${SANITIZERS} AND NOT WIN32) list(APPEND _INTERNAL_FLAGS "-fsanitize=address" "-fsanitize=undefined" "-fsanitize=leak") diff --git a/vendor/CMakeLists.txt b/vendor/CMakeLists.txt index 8c73f90..7ddb658 100644 --- a/vendor/CMakeLists.txt +++ b/vendor/CMakeLists.txt @@ -2,3 +2,8 @@ cmake_minimum_required(VERSION 3.10) add_library(dmusic-tsf STATIC TinySoundFont/tsf.c) target_include_directories(dmusic-tsf PUBLIC TinySoundFont) + +if (NOT MSVC) + target_compile_options(dmusic-tsf PRIVATE "-fPIC") + target_link_options(dmusic-tsf PRIVATE "-fPIC") +endif ()