mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 13:12:46 +00:00 
			
		
		
		
	 ce2f1b845f
			
		
	
	
		ce2f1b845f
		
	
	
	
	
		
			
			Otherwise, we end up propagating those dependencies into targets that link against that library, which creates unnecessary link-time dependencies. Also included are changes to readd now missing dependencies to tools that actually need them.
		
			
				
	
	
		
			29 lines
		
	
	
	
		
			949 B
		
	
	
	
		
			CMake
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
	
		
			949 B
		
	
	
	
		
			CMake
		
	
	
	
	
	
| set(CMAKE_SKIP_RPATH FALSE)
 | |
| macro(add_dlopen_lib NAME FUNCTION)
 | |
|     add_library(${NAME} SHARED Dynlib.cpp)
 | |
|     target_compile_definitions(${NAME} PRIVATE -DFUNCTION=${FUNCTION})
 | |
|     # LibLine is not special, just an "external" dependency
 | |
|     target_link_libraries(${NAME} PRIVATE LibLine)
 | |
|     serenity_set_implicit_links(${NAME})
 | |
| 	 # Avoid execution by the test runner
 | |
|     install(TARGETS ${NAME}
 | |
|             DESTINATION usr/Tests/LibELF
 | |
|             PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE GROUP_WRITE)
 | |
| endmacro()
 | |
| add_dlopen_lib(DynlibA dynliba_function)
 | |
| add_dlopen_lib(DynlibB dynlibb_function)
 | |
| 
 | |
| add_dlopen_lib(DynlibC dynlibc_function)
 | |
| set(CMAKE_INSTALL_RPATH $ORIGIN)
 | |
| add_dlopen_lib(DynlibD dynlibd_function)
 | |
| target_link_libraries(DynlibD PRIVATE DynlibC)
 | |
| unset(CMAKE_INSTALL_RPATH)
 | |
| 
 | |
| set(TEST_SOURCES
 | |
|     test-elf.cpp
 | |
|     TestDlOpen.cpp
 | |
| )
 | |
| 
 | |
| foreach(source IN LISTS TEST_SOURCES)
 | |
|     serenity_test("${source}" LibELF)
 | |
| endforeach()
 |