diff options
author | Wohlstand <admin@wohlnet.ru> | 2019-09-23 12:33:43 +0300 |
---|---|---|
committer | Wohlstand <admin@wohlnet.ru> | 2019-09-23 12:33:43 +0300 |
commit | 8749ddc3da9574c2406a7dfd2fd6a4639148beef (patch) | |
tree | 6a9c4efffeca6941d4a6e4f5ad76eb9eb81896ed /examples/sdl2_audio | |
parent | 62a018a1338b807d325d44a512499cf31563ab26 (diff) | |
download | libADLMIDI-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 'examples/sdl2_audio')
-rw-r--r-- | examples/sdl2_audio/CMakeLists.txt | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/examples/sdl2_audio/CMakeLists.txt b/examples/sdl2_audio/CMakeLists.txt index e1f797a..fa206a7 100644 --- a/examples/sdl2_audio/CMakeLists.txt +++ b/examples/sdl2_audio/CMakeLists.txt @@ -5,6 +5,10 @@ add_executable(adlmidi_sdl2_demo sdl2_sample.c) target_include_directories(adlmidi_sdl2_demo PRIVATE ${SDL2_INCLUDE_DIRS}) target_link_libraries(adlmidi_sdl2_demo PRIVATE ADLMIDI ${SDL2_LIBRARIES}) +if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) + set_property(TARGET adlmidi_sdl2_demo APPEND_STRING PROPERTY LINK_FLAGS " -no-pie") +endif() + if(NOT MSVC) target_link_libraries(adlmidi_sdl2_demo PRIVATE pthread) endif() @@ -18,3 +22,4 @@ endif() install(TARGETS adlmidi_sdl2_demo RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") + |