aboutsummaryrefslogtreecommitdiff
path: root/utils/midiplay
diff options
context:
space:
mode:
authorWohlstand <admin@wohlnet.ru>2019-09-23 12:33:43 +0300
committerWohlstand <admin@wohlnet.ru>2019-09-23 12:33:43 +0300
commit8749ddc3da9574c2406a7dfd2fd6a4639148beef (patch)
tree6a9c4efffeca6941d4a6e4f5ad76eb9eb81896ed /utils/midiplay
parent62a018a1338b807d325d44a512499cf31563ab26 (diff)
downloadlibADLMIDI-8749ddc3da9574c2406a7dfd2fd6a4639148beef.tar.gz
libADLMIDI-8749ddc3da9574c2406a7dfd2fd6a4639148beef.tar.bz2
libADLMIDI-8749ddc3da9574c2406a7dfd2fd6a4639148beef.zip
Set "-no-pie" to all executables built by GCC
Otherwise, this happens: https://stackoverflow.com/questions/46551213/gcc-7-2-compiles-shared-library-instead-of-executable
Diffstat (limited to 'utils/midiplay')
-rw-r--r--utils/midiplay/CMakeLists.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/utils/midiplay/CMakeLists.txt b/utils/midiplay/CMakeLists.txt
index 59f77fe..14766b6 100644
--- a/utils/midiplay/CMakeLists.txt
+++ b/utils/midiplay/CMakeLists.txt
@@ -3,6 +3,10 @@ add_executable(adlmidiplay
wave_writer.c
)
+if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
+ set_property(TARGET adlmidiplay APPEND_STRING PROPERTY LINK_FLAGS " -no-pie")
+endif()
+
if(NOT ADLMIDI_DOS AND NOT MIDIPLAY_WAVE_ONLY)
libADLMIDI_find_SDL2()
target_link_libraries(adlmidiplay PRIVATE ADLMIDI_SDL2)
@@ -41,3 +45,4 @@ endif()
install(TARGETS adlmidiplay
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
+