mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-31 05:40:04 +00:00 
			
		
		
		
	Merge pull request #2734 from yuriks/cmake-imported-libs
CMake: Use CMake target properties for all libraries
This commit is contained in:
		
						commit
						a4f88c7d7c
					
				
					 14 changed files with 160 additions and 120 deletions
				
			
		|  | @ -27,12 +27,9 @@ set(HEADERS | |||
|             time_stretch.h | ||||
|             ) | ||||
| 
 | ||||
| include_directories(../../externals/soundtouch/include) | ||||
| 
 | ||||
| if(SDL2_FOUND) | ||||
|     set(SRCS ${SRCS} sdl2_sink.cpp) | ||||
|     set(HEADERS ${HEADERS} sdl2_sink.h) | ||||
|     include_directories(${SDL2_INCLUDE_DIR}) | ||||
| endif() | ||||
| 
 | ||||
| create_directory_groups(${SRCS} ${HEADERS}) | ||||
|  | @ -42,6 +39,6 @@ target_link_libraries(audio_core PUBLIC common core) | |||
| target_link_libraries(audio_core PRIVATE SoundTouch) | ||||
| 
 | ||||
| if(SDL2_FOUND) | ||||
|     target_link_libraries(audio_core PRIVATE ${SDL2_LIBRARY}) | ||||
|     target_link_libraries(audio_core PRIVATE SDL2) | ||||
|     target_compile_definitions(audio_core PRIVATE HAVE_SDL2) | ||||
| endif() | ||||
|  |  | |||
|  | @ -15,15 +15,13 @@ set(HEADERS | |||
| 
 | ||||
| create_directory_groups(${SRCS} ${HEADERS}) | ||||
| 
 | ||||
| include_directories(${SDL2_INCLUDE_DIR}) | ||||
| 
 | ||||
| add_executable(citra ${SRCS} ${HEADERS}) | ||||
| target_link_libraries(citra PRIVATE common core input_common) | ||||
| target_link_libraries(citra PRIVATE ${SDL2_LIBRARY} ${OPENGL_gl_LIBRARY} inih glad) | ||||
| target_link_libraries(citra PRIVATE inih glad) | ||||
| if (MSVC) | ||||
|     target_link_libraries(citra PRIVATE getopt) | ||||
| endif() | ||||
| target_link_libraries(citra PRIVATE ${PLATFORM_LIBRARIES} Threads::Threads) | ||||
| target_link_libraries(citra PRIVATE ${PLATFORM_LIBRARIES} SDL2 Threads::Threads) | ||||
| 
 | ||||
| if(UNIX AND NOT APPLE) | ||||
|     install(TARGETS citra RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin") | ||||
|  |  | |||
|  | @ -92,7 +92,7 @@ else() | |||
|     add_executable(citra-qt ${SRCS} ${HEADERS} ${UI_HDRS}) | ||||
| endif() | ||||
| target_link_libraries(citra-qt PRIVATE audio_core common core input_common video_core) | ||||
| target_link_libraries(citra-qt PRIVATE ${OPENGL_gl_LIBRARY} ${CITRA_QT_LIBS} glad) | ||||
| target_link_libraries(citra-qt PRIVATE Boost::boost glad nihstro-headers Qt5::OpenGL Qt5::Widgets) | ||||
| target_link_libraries(citra-qt PRIVATE ${PLATFORM_LIBRARIES} Threads::Threads) | ||||
| 
 | ||||
| if(UNIX AND NOT APPLE) | ||||
|  |  | |||
|  | @ -95,6 +95,7 @@ endif() | |||
| create_directory_groups(${SRCS} ${HEADERS}) | ||||
| 
 | ||||
| add_library(common STATIC ${SRCS} ${HEADERS}) | ||||
| target_link_libraries(common PUBLIC Boost::boost microprofile) | ||||
| if (ARCHITECTURE_x86_64) | ||||
|     target_link_libraries(common PRIVATE xbyak) | ||||
| endif() | ||||
|  |  | |||
|  | @ -374,11 +374,7 @@ set(HEADERS | |||
|             telemetry_session.h | ||||
|             ) | ||||
| 
 | ||||
| include_directories(../../externals/dynarmic/include) | ||||
| include_directories(../../externals/cryptopp) | ||||
| 
 | ||||
| create_directory_groups(${SRCS} ${HEADERS}) | ||||
| 
 | ||||
| add_library(core STATIC ${SRCS} ${HEADERS}) | ||||
| target_link_libraries(core PUBLIC common PRIVATE audio_core video_core) | ||||
| target_link_libraries(core PRIVATE cryptopp dynarmic) | ||||
| target_link_libraries(core PUBLIC Boost::boost PRIVATE cryptopp dynarmic) | ||||
|  |  | |||
|  | @ -13,7 +13,6 @@ set(HEADERS | |||
| if(SDL2_FOUND) | ||||
|     set(SRCS ${SRCS} sdl/sdl.cpp) | ||||
|     set(HEADERS ${HEADERS} sdl/sdl.h) | ||||
|     include_directories(${SDL2_INCLUDE_DIR}) | ||||
| endif() | ||||
| 
 | ||||
| create_directory_groups(${SRCS} ${HEADERS}) | ||||
|  | @ -22,6 +21,6 @@ add_library(input_common STATIC ${SRCS} ${HEADERS}) | |||
| target_link_libraries(input_common PUBLIC core PRIVATE common) | ||||
| 
 | ||||
| if(SDL2_FOUND) | ||||
|     target_link_libraries(input_common PRIVATE ${SDL2_LIBRARY}) | ||||
|     target_link_libraries(input_common PRIVATE SDL2) | ||||
|     target_compile_definitions(input_common PRIVATE HAVE_SDL2) | ||||
| endif() | ||||
|  |  | |||
|  | @ -10,11 +10,9 @@ set(HEADERS | |||
| 
 | ||||
| create_directory_groups(${SRCS} ${HEADERS}) | ||||
| 
 | ||||
| include_directories(../../externals/catch/single_include/) | ||||
| 
 | ||||
| add_executable(tests ${SRCS} ${HEADERS}) | ||||
| target_link_libraries(tests PRIVATE common core) | ||||
| target_link_libraries(tests PRIVATE glad) # To support linker work-around | ||||
| target_link_libraries(tests PRIVATE ${PLATFORM_LIBRARIES} Threads::Threads) | ||||
| target_link_libraries(tests PRIVATE ${PLATFORM_LIBRARIES} catch-single-include Threads::Threads) | ||||
| 
 | ||||
| add_test(NAME tests COMMAND $<TARGET_FILE:tests>) | ||||
| add_test(NAME tests COMMAND tests) | ||||
|  |  | |||
|  | @ -80,14 +80,13 @@ create_directory_groups(${SRCS} ${HEADERS}) | |||
| 
 | ||||
| add_library(video_core STATIC ${SRCS} ${HEADERS}) | ||||
| target_link_libraries(video_core PUBLIC common core) | ||||
| target_link_libraries(video_core PRIVATE glad) | ||||
| target_link_libraries(video_core PRIVATE glad nihstro-headers) | ||||
| 
 | ||||
| if (ARCHITECTURE_x86_64) | ||||
|     target_link_libraries(video_core PRIVATE xbyak) | ||||
| endif() | ||||
| 
 | ||||
| if (PNG_FOUND) | ||||
|     target_link_libraries(video_core PRIVATE ${PNG_LIBRARIES}) | ||||
|     target_include_directories(video_core PRIVATE ${PNG_INCLUDE_DIRS}) | ||||
|     target_compile_definitions(video_core PRIVATE ${PNG_DEFINITIONS}) | ||||
|     target_link_libraries(video_core PRIVATE PNG::PNG) | ||||
|     target_compile_definitions(video_core PRIVATE HAVE_PNG) | ||||
| endif() | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue