From e211cdd11dac60dbeb61d3849c88216dbdc5544d Mon Sep 17 00:00:00 2001 From: Florent Castelli Date: Mon, 6 Feb 2017 04:18:51 +0100 Subject: [PATCH 1/3] cmake: Fix possible redefinition of imported target in FindALSA --- CMakeTests/FindALSA.cmake | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/CMakeTests/FindALSA.cmake b/CMakeTests/FindALSA.cmake index 86c1510287..45e2bccdf4 100644 --- a/CMakeTests/FindALSA.cmake +++ b/CMakeTests/FindALSA.cmake @@ -47,11 +47,13 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(ALSA if(ALSA_FOUND) set( ALSA_LIBRARIES ${ALSA_LIBRARY} ) set( ALSA_INCLUDE_DIRS ${ALSA_INCLUDE_DIR} ) - add_library(ALSA::ALSA UNKNOWN IMPORTED) - set_target_properties(ALSA::ALSA PROPERTIES - IMPORTED_LOCATION ${ALSA_LIBRARY} - INTERFACE_INCLUDE_DIRECTORIES ${ALSA_INCLUDE_DIR} - ) + if(NOT TARGET ALSA::ALSA) + add_library(ALSA::ALSA UNKNOWN IMPORTED) + set_target_properties(ALSA::ALSA PROPERTIES + IMPORTED_LOCATION ${ALSA_LIBRARY} + INTERFACE_INCLUDE_DIRECTORIES ${ALSA_INCLUDE_DIR} + ) + endif() endif() mark_as_advanced(ALSA_INCLUDE_DIR ALSA_LIBRARY) From 3dfae32963d34d29435bd2504909d3fcc36c20c3 Mon Sep 17 00:00:00 2001 From: Florent Castelli Date: Mon, 6 Feb 2017 04:18:59 +0100 Subject: [PATCH 2/3] cmake: Fix possible redefinition of imported target in FindOpenSLES --- CMakeTests/FindOpenSLES.cmake | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/CMakeTests/FindOpenSLES.cmake b/CMakeTests/FindOpenSLES.cmake index 8dd6569662..b50efc6067 100644 --- a/CMakeTests/FindOpenSLES.cmake +++ b/CMakeTests/FindOpenSLES.cmake @@ -18,11 +18,13 @@ find_package_handle_standard_args(OpenSLES DEFAULT_MSG OPENSLES_LIBRARY OPENSLES_INCLUDE_DIR) if(OpenSLES_FOUND) - add_library(OpenSLES::OpenSLES UNKNOWN IMPORTED) - set_target_properties(OpenSLES::OpenSLES PROPERTIES - IMPORTED_LOCATION ${OPENSLES_LIBRARY} - INTERFACE_INCLUDE_DIRECTORIES ${OPENSLES_INCLUDE_DIR} - ) + if(NOT TARGET OpenSLES::OpenSLES) + add_library(OpenSLES::OpenSLES UNKNOWN IMPORTED) + set_target_properties(OpenSLES::OpenSLES PROPERTIES + IMPORTED_LOCATION ${OPENSLES_LIBRARY} + INTERFACE_INCLUDE_DIRECTORIES ${OPENSLES_INCLUDE_DIR} + ) + endif() endif() mark_as_advanced(OPENSLES_INCLUDE_DIR OPENSLES_LIBRARY ) From 8464480ceb844307dcec2b05fea3048905eac94b Mon Sep 17 00:00:00 2001 From: Florent Castelli Date: Fri, 3 Feb 2017 23:21:11 +0100 Subject: [PATCH 3/3] cmake: Remove -nopie, -no-pie should be used instead --- CMakeLists.txt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cd392eb84d..4341fc004c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -241,10 +241,6 @@ else() if(NO_PIE_UPSTREAM) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -no-pie") endif() - check_c_compiler_flag("-nopie" NO_PIE_PATCHED) - if(NO_PIE_PATCHED) - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -nopie") - endif() endif() endif()