| 
									
										
										
										
											2022-01-06 22:25:22 +00:00
										 |  |  | #  SPDX-License-Identifier: MIT
 | 
					
						
							|  |  |  | #
 | 
					
						
							|  |  |  | #  EmulationStation Desktop Edition
 | 
					
						
							|  |  |  | #  CMakeLists.txt (external)
 | 
					
						
							|  |  |  | #
 | 
					
						
							|  |  |  | #  CMake configuration for bundled dependencies built in-tree.
 | 
					
						
							|  |  |  | #
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-10-04 15:31:03 +00:00
										 |  |  | # This makes it possible to set options in subprojects.
 | 
					
						
							|  |  |  | set (CMAKE_POLICY_DEFAULT_CMP0077 NEW)
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-11 19:19:41 +00:00
										 |  |  | # Suppress warnings about cmake_minimum_required() defining deprecated versions.
 | 
					
						
							|  |  |  | set(CMAKE_WARN_DEPRECATED OFF CACHE BOOL "" FORCE)
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-10-04 15:31:03 +00:00
										 |  |  | if (WIN32)
 | 
					
						
							|  |  |  |     # On Windows the build type needs to match the main binary.
 | 
					
						
							|  |  |  |     if (CMAKE_BUILD_TYPE MATCHES Profiling)
 | 
					
						
							|  |  |  |         set (CMAKE_BUILD_TYPE Release)
 | 
					
						
							|  |  |  |     elseif(NOT CMAKE_BUILD_TYPE MATCHES Debug)
 | 
					
						
							|  |  |  |         set (CMAKE_BUILD_TYPE Release)
 | 
					
						
							|  |  |  |     endif()
 | 
					
						
							|  |  |  | else()
 | 
					
						
							|  |  |  |     # Always build with optimizations enabled and without debug info.
 | 
					
						
							| 
									
										
										
										
											2022-10-03 19:40:20 +00:00
										 |  |  |     set (CMAKE_BUILD_TYPE Release)
 | 
					
						
							|  |  |  | endif()
 | 
					
						
							| 
									
										
										
										
											2022-01-06 23:29:31 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-10-04 15:31:03 +00:00
										 |  |  | unset(CMAKE_CXX_FLAGS)
 | 
					
						
							|  |  |  | unset(CMAKE_EXE_LINKER_FLAGS)
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-10 20:25:05 +00:00
										 |  |  | # Strip the DLL files when building with MinGW.
 | 
					
						
							|  |  |  | if(WIN32 AND NOT CMAKE_CXX_COMPILER_ID MATCHES MSVC)
 | 
					
						
							|  |  |  |     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s")
 | 
					
						
							| 
									
										
										
										
											2022-10-08 09:12:45 +00:00
										 |  |  | endif()
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | if (WIN32)
 | 
					
						
							|  |  |  |     set(BUILD_SHARED_LIBS ON)
 | 
					
						
							|  |  |  | else()
 | 
					
						
							|  |  |  |     set(BUILD_SHARED_LIBS OFF)
 | 
					
						
							| 
									
										
										
										
											2022-10-04 15:31:03 +00:00
										 |  |  | endif()
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | add_subdirectory(lunasvg EXCLUDE_FROM_ALL)
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-10 20:25:05 +00:00
										 |  |  | # Disable LunaSVG DLL interface warnings and narrowing conversion warnings.
 | 
					
						
							|  |  |  | if(CMAKE_CXX_COMPILER_ID MATCHES MSVC)
 | 
					
						
							|  |  |  |     target_compile_options(lunasvg PRIVATE "/wd4251" "/wd4267")
 | 
					
						
							|  |  |  | endif()
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-10-04 15:31:03 +00:00
										 |  |  | # Disable threading support for rlottie as this functionality actually leads to far worse
 | 
					
						
							| 
									
										
										
										
											2022-01-09 12:32:28 +00:00
										 |  |  | # performance. As well there is a bug on Windows that makes rlottie hang forever on application
 | 
					
						
							|  |  |  | # shutdown if compiled using MinGW with threading support enabled.
 | 
					
						
							|  |  |  | option(LOTTIE_THREAD OFF)
 | 
					
						
							| 
									
										
										
										
											2022-01-07 21:51:14 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-01-06 22:25:22 +00:00
										 |  |  | option(LOTTIE_MODULE OFF)
 | 
					
						
							| 
									
										
										
										
											2022-01-08 15:23:23 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-01-13 19:32:30 +00:00
										 |  |  | if(EMSCRIPTEN)
 | 
					
						
							| 
									
										
										
										
											2022-04-19 15:24:54 +00:00
										 |  |  |     set(CMAKE_CXX_FLAGS -pthread)
 | 
					
						
							| 
									
										
										
										
											2022-01-13 19:32:30 +00:00
										 |  |  | endif()
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-10 20:25:05 +00:00
										 |  |  | add_subdirectory(rlottie EXCLUDE_FROM_ALL)
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-10-03 16:43:30 +00:00
										 |  |  | # rlottie generates a lot of annoying compiler warnings that we don't need to show.
 | 
					
						
							|  |  |  | if(CMAKE_CXX_COMPILER_ID MATCHES MSVC)
 | 
					
						
							| 
									
										
										
										
											2023-08-10 20:25:05 +00:00
										 |  |  |     target_compile_options(rlottie PRIVATE "/wd4244" "/wd4251" "/wd4263" "/wd4334" "/wd4267" "/wd4530" "/wd4996")
 | 
					
						
							| 
									
										
										
										
											2022-10-03 16:43:30 +00:00
										 |  |  | else()
 | 
					
						
							| 
									
										
										
										
											2023-08-10 20:25:05 +00:00
										 |  |  |     target_compile_options(rlottie PRIVATE "-w")
 | 
					
						
							| 
									
										
										
										
											2022-10-03 16:43:30 +00:00
										 |  |  | endif()
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Build LunaSVG before rlottie.
 | 
					
						
							|  |  |  | add_dependencies(rlottie lunasvg)
 |