Move libdl/libpthread handling to common_options
Setting -pthread makes linking libatomic manually unneeded
This commit is contained in:
		
							parent
							
								
									f2384057de
								
							
						
					
					
						commit
						10108ea237
					
				
					 14 changed files with 2 additions and 63 deletions
				
			
		
							
								
								
									
										5
									
								
								external/auto_updates/xz/CMakeLists.txt
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								external/auto_updates/xz/CMakeLists.txt
									
										
									
									
										vendored
									
									
								
							|  | @ -24,9 +24,4 @@ else() | ||||||
|     INTERFACE |     INTERFACE | ||||||
|         lzma |         lzma | ||||||
|     ) |     ) | ||||||
| 
 |  | ||||||
|     target_link_libraries(external_xz |  | ||||||
|     INTERFACE |  | ||||||
|         ${CMAKE_DL_LIBS} |  | ||||||
|     ) |  | ||||||
| endif() | endif() | ||||||
|  |  | ||||||
							
								
								
									
										1
									
								
								external/dispatch/CMakeLists.txt
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								external/dispatch/CMakeLists.txt
									
										
									
									
										vendored
									
									
								
							|  | @ -61,7 +61,6 @@ INTERFACE | ||||||
| target_link_libraries(external_dispatch_bundled | target_link_libraries(external_dispatch_bundled | ||||||
| INTERFACE | INTERFACE | ||||||
|     ${dispatch_binary_dir}/src/BlocksRuntime/libBlocksRuntime.a |     ${dispatch_binary_dir}/src/BlocksRuntime/libBlocksRuntime.a | ||||||
|     pthread |  | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| target_link_libraries(external_dispatch | target_link_libraries(external_dispatch | ||||||
|  |  | ||||||
							
								
								
									
										1
									
								
								external/ffmpeg/CMakeLists.txt
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								external/ffmpeg/CMakeLists.txt
									
										
									
									
										vendored
									
									
								
							|  | @ -57,7 +57,6 @@ else() | ||||||
|         target_link_libraries(external_ffmpeg |         target_link_libraries(external_ffmpeg | ||||||
|         INTERFACE |         INTERFACE | ||||||
|             X11 |             X11 | ||||||
|             pthread |  | ||||||
|         ) |         ) | ||||||
|     endif() |     endif() | ||||||
| endif() | endif() | ||||||
|  |  | ||||||
|  | @ -32,9 +32,4 @@ else() | ||||||
|     PRIVATE |     PRIVATE | ||||||
|         ${X11_INCLUDE_DIRS} |         ${X11_INCLUDE_DIRS} | ||||||
|     ) |     ) | ||||||
| 
 |  | ||||||
|     target_link_libraries(external_hime_im_client |  | ||||||
|     PRIVATE |  | ||||||
|         ${CMAKE_DL_LIBS} |  | ||||||
|     ) |  | ||||||
| endif() | endif() | ||||||
|  |  | ||||||
							
								
								
									
										6
									
								
								external/jemalloc/CMakeLists.txt
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								external/jemalloc/CMakeLists.txt
									
										
									
									
										vendored
									
									
								
							|  | @ -51,12 +51,6 @@ INTERFACE | ||||||
|     ${SOURCE_DIR}/include |     ${SOURCE_DIR}/include | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| target_link_libraries(external_jemalloc_bundled |  | ||||||
| INTERFACE |  | ||||||
|     ${CMAKE_DL_LIBS} |  | ||||||
|     pthread |  | ||||||
| ) |  | ||||||
| 
 |  | ||||||
| add_dependencies(external_jemalloc_bundled jemalloc-build) | add_dependencies(external_jemalloc_bundled jemalloc-build) | ||||||
| 
 | 
 | ||||||
| target_link_libraries(external_jemalloc | target_link_libraries(external_jemalloc | ||||||
|  |  | ||||||
							
								
								
									
										1
									
								
								external/nimf_qt5/CMakeLists.txt
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								external/nimf_qt5/CMakeLists.txt
									
										
									
									
										vendored
									
									
								
							|  | @ -45,6 +45,5 @@ else() | ||||||
|     target_link_libraries(external_nimf_qt5 |     target_link_libraries(external_nimf_qt5 | ||||||
|     PRIVATE |     PRIVATE | ||||||
|         desktop-app::external_qt |         desktop-app::external_qt | ||||||
|         ${CMAKE_DL_LIBS} |  | ||||||
|     ) |     ) | ||||||
| endif() | endif() | ||||||
|  |  | ||||||
							
								
								
									
										5
									
								
								external/openal/CMakeLists.txt
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								external/openal/CMakeLists.txt
									
										
									
									
										vendored
									
									
								
							|  | @ -47,11 +47,6 @@ else() | ||||||
|     INTERFACE |     INTERFACE | ||||||
|         openal |         openal | ||||||
|     ) |     ) | ||||||
|     target_link_libraries(external_openal |  | ||||||
|     INTERFACE |  | ||||||
|         ${CMAKE_DL_LIBS} |  | ||||||
|         pthread |  | ||||||
|     ) |  | ||||||
| endif() | endif() | ||||||
| 
 | 
 | ||||||
| if (NOT DESKTOP_APP_USE_PACKAGED) | if (NOT DESKTOP_APP_USE_PACKAGED) | ||||||
|  |  | ||||||
|  | @ -19,12 +19,4 @@ if (NOT DESKTOP_APP_USE_PACKAGED) | ||||||
|             ${libs_loc}/openssl/include |             ${libs_loc}/openssl/include | ||||||
|         ) |         ) | ||||||
|     endif() |     endif() | ||||||
| 
 |  | ||||||
|     if (LINUX) |  | ||||||
|         target_link_libraries(external_openssl_common |  | ||||||
|         INTERFACE |  | ||||||
|             ${CMAKE_DL_LIBS} |  | ||||||
|             pthread |  | ||||||
|         ) |  | ||||||
|     endif() |  | ||||||
| endif() | endif() | ||||||
|  |  | ||||||
							
								
								
									
										2
									
								
								external/qt/CMakeLists.txt
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								external/qt/CMakeLists.txt
									
										
									
									
										vendored
									
									
								
							|  | @ -305,8 +305,6 @@ else() | ||||||
|             xcb |             xcb | ||||||
|             X11 |             X11 | ||||||
|             X11-xcb |             X11-xcb | ||||||
|             ${CMAKE_DL_LIBS} |  | ||||||
|             pthread |  | ||||||
|         ) |         ) | ||||||
|     endif() |     endif() | ||||||
| endif() | endif() | ||||||
|  |  | ||||||
							
								
								
									
										2
									
								
								external/qt/qt6/CMakeLists.txt
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								external/qt/qt6/CMakeLists.txt
									
										
									
									
										vendored
									
									
								
							|  | @ -280,8 +280,6 @@ else() | ||||||
|             xcb |             xcb | ||||||
|             X11 |             X11 | ||||||
|             X11-xcb |             X11-xcb | ||||||
|             ${CMAKE_DL_LIBS} |  | ||||||
|             pthread |  | ||||||
|         ) |         ) | ||||||
|     endif() |     endif() | ||||||
| endif() | endif() | ||||||
|  |  | ||||||
							
								
								
									
										7
									
								
								external/rlottie/CMakeLists.txt
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										7
									
								
								external/rlottie/CMakeLists.txt
									
										
									
									
										vendored
									
									
								
							|  | @ -133,13 +133,6 @@ else() | ||||||
|         ${rlottie_loc}/src/vector/freetype |         ${rlottie_loc}/src/vector/freetype | ||||||
|     ) |     ) | ||||||
| 
 | 
 | ||||||
|     if (LINUX) |  | ||||||
|         target_link_libraries(external_rlottie_bundled |  | ||||||
|         PRIVATE |  | ||||||
|             pthread |  | ||||||
|         ) |  | ||||||
|     endif() |  | ||||||
| 
 |  | ||||||
|     if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") |     if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") | ||||||
|         target_compile_options(external_rlottie_bundled |         target_compile_options(external_rlottie_bundled | ||||||
|         PRIVATE |         PRIVATE | ||||||
|  |  | ||||||
|  | @ -16,5 +16,4 @@ PRIVATE | ||||||
| target_link_libraries(linux_wayland_helper | target_link_libraries(linux_wayland_helper | ||||||
| PUBLIC | PUBLIC | ||||||
|     desktop-app::external_gsl |     desktop-app::external_gsl | ||||||
|     ${CMAKE_DL_LIBS} |  | ||||||
| ) | ) | ||||||
|  |  | ||||||
|  | @ -12,8 +12,3 @@ nice_target_sources(linux_xcb_helper ${CMAKE_CURRENT_SOURCE_DIR} | ||||||
| PRIVATE | PRIVATE | ||||||
|     linux_xcb_helper.cpp |     linux_xcb_helper.cpp | ||||||
| ) | ) | ||||||
| 
 |  | ||||||
| target_link_libraries(linux_xcb_helper |  | ||||||
| PUBLIC |  | ||||||
|     ${CMAKE_DL_LIBS} |  | ||||||
| ) |  | ||||||
|  |  | ||||||
|  | @ -28,6 +28,7 @@ INTERFACE | ||||||
| target_link_options(common_options | target_link_options(common_options | ||||||
| INTERFACE | INTERFACE | ||||||
|     -Wl,--as-needed |     -Wl,--as-needed | ||||||
|  |     -pthread | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") | if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") | ||||||
|  | @ -64,6 +65,7 @@ endif() | ||||||
| target_link_libraries(common_options | target_link_libraries(common_options | ||||||
| INTERFACE | INTERFACE | ||||||
|     desktop-app::external_jemalloc |     desktop-app::external_jemalloc | ||||||
|  |     ${CMAKE_DL_LIBS} | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| if (DESKTOP_APP_USE_ALLOCATION_TRACER) | if (DESKTOP_APP_USE_ALLOCATION_TRACER) | ||||||
|  | @ -109,7 +111,6 @@ if (NOT DESKTOP_APP_USE_PACKAGED) | ||||||
|     endif() |     endif() | ||||||
|     target_link_options(common_options |     target_link_options(common_options | ||||||
|     INTERFACE |     INTERFACE | ||||||
|         -pthread |  | ||||||
|         -rdynamic |         -rdynamic | ||||||
|         -fwhole-program |         -fwhole-program | ||||||
|         -Wl,-z,relro |         -Wl,-z,relro | ||||||
|  | @ -117,16 +118,3 @@ if (NOT DESKTOP_APP_USE_PACKAGED) | ||||||
|         # -pie # https://gitlab.gnome.org/GNOME/nautilus/-/issues/1601 |         # -pie # https://gitlab.gnome.org/GNOME/nautilus/-/issues/1601 | ||||||
|     ) |     ) | ||||||
| endif() | endif() | ||||||
| 
 |  | ||||||
| if (DESKTOP_APP_USE_PACKAGED) |  | ||||||
|     find_library(ATOMIC_LIBRARY atomic) |  | ||||||
| else() |  | ||||||
|     find_library(ATOMIC_LIBRARY libatomic.a) |  | ||||||
| endif() |  | ||||||
| 
 |  | ||||||
| if (ATOMIC_LIBRARY) |  | ||||||
|     target_link_libraries(common_options |  | ||||||
|     INTERFACE |  | ||||||
|         ${ATOMIC_LIBRARY} |  | ||||||
|     ) |  | ||||||
| endif() |  | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Ilya Fedin
						Ilya Fedin