Skip to content

Commit 50365b7

Browse files
committed
cmake: update CMAKE_POSITION_INDEPENDENT_CODE
1 parent 1b8acd6 commit 50365b7

File tree

12 files changed

+3
-45
lines changed

12 files changed

+3
-45
lines changed

3rdparty/carotene/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,4 @@ if(WITH_NEON)
3737
target_compile_definitions(carotene_objs PRIVATE "-DWITH_NEON")
3838
endif()
3939

40-
set_target_properties(carotene_objs PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
41-
4240
add_library(carotene STATIC EXCLUDE_FROM_ALL "$<TARGET_OBJECTS:carotene_objs>")

3rdparty/carotene/hal/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
33
include(CheckCCompilerFlag)
44
include(CheckCXXCompilerFlag)
55

6-
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
7-
86
set(TEGRA_HAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
97
set(CAROTENE_DIR "${TEGRA_HAL_DIR}/../")
108

@@ -95,7 +93,6 @@ set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS ${carotene_defs})
9593
endif()
9694

9795
add_library(tegra_hal STATIC $<TARGET_OBJECTS:carotene_objs>)
98-
set_target_properties(tegra_hal PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
9996
set_target_properties(tegra_hal PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH})
10097
set(OPENCV_SRC_DIR "${CMAKE_SOURCE_DIR}")
10198
if(NOT BUILD_SHARED_LIBS)

3rdparty/ippicv/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ add_library(${IPP_IW_LIBRARY} STATIC ${lib_srcs} ${lib_hdrs})
2121

2222
if(UNIX)
2323
if(CMAKE_COMPILER_IS_GNUCXX OR CV_ICC)
24-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -Wno-unused-function -Wno-missing-braces -Wno-missing-field-initializers")
24+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-function -Wno-missing-braces -Wno-missing-field-initializers")
2525
endif()
2626
if (CMAKE_C_COMPILER_ID MATCHES "Clang")
2727
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-self-assign")

3rdparty/ittnotify/CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,6 @@ if(NOT WIN32)
4343
endif()
4444
endif()
4545

46-
if(UNIX)
47-
if(CMAKE_COMPILER_IS_GNUCXX OR CV_ICC)
48-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
49-
endif()
50-
endif()
51-
5246
set_target_properties(${ITT_LIBRARY} PROPERTIES
5347
OUTPUT_NAME ${ITT_LIBRARY}
5448
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"

3rdparty/libjasper/CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,6 @@ ocv_warnings_disable(CMAKE_C_FLAGS -Wno-implicit-function-declaration -Wno-unini
3131
ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-parameter -Wstrict-prototypes) # clang
3232
ocv_warnings_disable(CMAKE_C_FLAGS /wd4013 /wd4018 /wd4101 /wd4244 /wd4267 /wd4715) # vs2005
3333

34-
if(UNIX)
35-
if(CMAKE_COMPILER_IS_GNUCXX OR CV_ICC)
36-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
37-
endif()
38-
endif()
39-
4034
set_target_properties(${JASPER_LIBRARY}
4135
PROPERTIES
4236
OUTPUT_NAME ${JASPER_LIBRARY}

3rdparty/libjpeg/CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,6 @@ endif()
2828

2929
add_library(${JPEG_LIBRARY} STATIC ${lib_srcs} ${lib_hdrs})
3030

31-
if(UNIX)
32-
if(CMAKE_COMPILER_IS_GNUCXX OR CV_ICC)
33-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
34-
endif()
35-
endif()
36-
3731
if(CMAKE_COMPILER_IS_GNUCXX)
3832
set_source_files_properties(jcdctmgr.c PROPERTIES COMPILE_FLAGS "-O1")
3933
endif()

3rdparty/libpng/CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,6 @@ endif(MSVC)
6363
add_library(${PNG_LIBRARY} STATIC ${lib_srcs} ${lib_hdrs})
6464
target_link_libraries(${PNG_LIBRARY} ${ZLIB_LIBRARIES})
6565

66-
if(UNIX)
67-
if(CMAKE_COMPILER_IS_GNUCXX OR CV_ICC)
68-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
69-
endif()
70-
endif()
71-
7266
ocv_warnings_disable(CMAKE_C_FLAGS -Wcast-align)
7367

7468
set_target_properties(${PNG_LIBRARY}

3rdparty/libtiff/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -449,10 +449,6 @@ ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4456 /wd4457 /wd4312) # vs2015
449449

450450
ocv_warnings_disable(CMAKE_C_FLAGS /wd4267 /wd4244 /wd4018 /wd4311 /wd4312)
451451

452-
if(UNIX AND (CMAKE_COMPILER_IS_GNUCXX OR CV_ICC))
453-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
454-
endif()
455-
456452
add_library(${TIFF_LIBRARY} STATIC ${lib_srcs})
457453
target_link_libraries(${TIFF_LIBRARY} ${ZLIB_LIBRARIES})
458454

3rdparty/openexr/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4244) # vs2008
5151
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4267) # vs2008 Win64
5252
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4456) # vs2015
5353

54-
if(UNIX AND (CMAKE_COMPILER_IS_GNUCXX OR CV_ICC))
55-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
56-
endif()
57-
5854
if(MSVC AND CV_ICC)
5955
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Qrestrict")
6056
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Qrestrict")

3rdparty/openvx/hal/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ target_include_directories(openvx_hal PUBLIC
66
${CMAKE_SOURCE_DIR}/modules/imgproc/include
77
${OPENVX_INCLUDE_DIR})
88
target_link_libraries(openvx_hal LINK_PUBLIC ${OPENVX_LIBRARIES})
9-
set_target_properties(openvx_hal PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
109
set_target_properties(openvx_hal PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH})
1110
if(NOT BUILD_SHARED_LIBS)
1211
ocv_install_target(openvx_hal EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)

0 commit comments

Comments
 (0)