Skip to content

Commit

Permalink
fix(build): remove -flto and add -fPIC to TSF
Browse files Browse the repository at this point in the history
  • Loading branch information
lmichaelis committed May 9, 2024
1 parent 9934252 commit e57b130
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion support/BuildSupport.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
5 changes: 5 additions & 0 deletions vendor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 ()

0 comments on commit e57b130

Please sign in to comment.