mirror of
				https://github.com/libsdl-org/SDL.git
				synced 2025-10-26 12:27:44 +00:00 
			
		
		
		
	cmake: gate all preseeding behind SDL_PRESEED option
This commit is contained in:
		 Anonymous Maarten
					Anonymous Maarten
				
			
				
					committed by
					
						 Anonymous Maarten
						Anonymous Maarten
					
				
			
			
				
	
			
			
			 Anonymous Maarten
						Anonymous Maarten
					
				
			
						parent
						
							546cd3ac83
						
					
				
				
					commit
					2aad26abb0
				
			| @@ -57,10 +57,6 @@ include("${SDL3_SOURCE_DIR}/cmake/PreseedEmscriptenCache.cmake") | |||||||
| SDL_DetectCompiler() | SDL_DetectCompiler() | ||||||
| SDL_DetectTargetCPUArchitectures(SDL_CPUS) | SDL_DetectTargetCPUArchitectures(SDL_CPUS) | ||||||
|  |  | ||||||
| if (SDL_PRESEED_FUNCTION_DEFINED) |  | ||||||
|   SDL_Preseed_CMakeCache() |  | ||||||
| endif() |  | ||||||
|  |  | ||||||
| # Increment this if there is an incompatible change - but if that happens, | # Increment this if there is an incompatible change - but if that happens, | ||||||
| # we should rename the library from SDL3 to SDL4, at which point this would | # we should rename the library from SDL3 to SDL4, at which point this would | ||||||
| # reset to 0 anyway. | # reset to 0 anyway. | ||||||
| @@ -257,11 +253,17 @@ else() | |||||||
|   set(SDL_RPATH_DEFAULT OFF) |   set(SDL_RPATH_DEFAULT OFF) | ||||||
| endif() | endif() | ||||||
|  |  | ||||||
|  | set(SDL_PRESEED_AVAILABLE OFF) | ||||||
|  | if(COMMAND SDL_Preseed_CMakeCache) | ||||||
|  |   set(SDL_PRESEED_AVAILABLE ON) | ||||||
|  | endif() | ||||||
|  |  | ||||||
| # Allow some projects to be built conditionally. | # Allow some projects to be built conditionally. | ||||||
| set_option(SDL_DISABLE_INSTALL    "Disable installation of SDL3" ${SDL3_SUBPROJECT}) | set_option(SDL_DISABLE_INSTALL    "Disable installation of SDL3" ${SDL3_SUBPROJECT}) | ||||||
| cmake_dependent_option(SDL_DISABLE_INSTALL_CPACK "Create binary SDL3 archive using CPack" ${SDL3_SUBPROJECT} "NOT SDL_DISABLE_INSTALL" ON) | cmake_dependent_option(SDL_DISABLE_INSTALL_CPACK "Create binary SDL3 archive using CPack" ${SDL3_SUBPROJECT} "NOT SDL_DISABLE_INSTALL" ON) | ||||||
| cmake_dependent_option(SDL_DISABLE_INSTALL_DOCS "Install docs for SDL3" ON "NOT SDL_DISABLE_INSTALL;NOT SDL_FRAMEWORK" ON) | cmake_dependent_option(SDL_DISABLE_INSTALL_DOCS "Install docs for SDL3" ON "NOT SDL_DISABLE_INSTALL;NOT SDL_FRAMEWORK" ON) | ||||||
| set_option(SDL_DISABLE_UNINSTALL  "Disable uninstallation of SDL3" OFF) | set_option(SDL_DISABLE_UNINSTALL  "Disable uninstallation of SDL3" OFF) | ||||||
|  | cmake_dependent_option(SDL_PRESEED "Preseed CMake cache to speed up configuration" ON "${SDL_PRESEED_AVAILABLE}" OFF) | ||||||
|  |  | ||||||
| cmake_dependent_option(SDL_DISABLE_ANDROID_JAR  "Disable creation of SDL3.jar" ${SDL3_SUBPROJECT} "ANDROID" ON) | cmake_dependent_option(SDL_DISABLE_ANDROID_JAR  "Disable creation of SDL3.jar" ${SDL3_SUBPROJECT} "ANDROID" ON) | ||||||
|  |  | ||||||
| @@ -370,6 +372,10 @@ if(NOT (SDL_SHARED OR SDL_STATIC)) | |||||||
|   message(FATAL_ERROR "SDL_SHARED and SDL_STATIC cannot both be disabled") |   message(FATAL_ERROR "SDL_SHARED and SDL_STATIC cannot both be disabled") | ||||||
| endif() | endif() | ||||||
|  |  | ||||||
|  | if(SDL_PRESEED) | ||||||
|  |   SDL_Preseed_CMakeCache() | ||||||
|  | endif() | ||||||
|  |  | ||||||
| if(SDL_SHARED) | if(SDL_SHARED) | ||||||
|   add_library(SDL3-shared SHARED) |   add_library(SDL3-shared SHARED) | ||||||
|   add_library(SDL3::SDL3-shared ALIAS SDL3-shared) |   add_library(SDL3::SDL3-shared ALIAS SDL3-shared) | ||||||
|   | |||||||
| @@ -1,7 +1,4 @@ | |||||||
| cmake_dependent_option(SDL_EMSCRIPTEN_PRESEED "Preseed CMake cache for Emscripten to speed up configuration" ON "EMSCRIPTEN" OFF) | if(EMSCRIPTEN) | ||||||
|  |  | ||||||
| if(SDL_EMSCRIPTEN_PRESEED) |  | ||||||
|   set(SDL_PRESEED_FUNCTION_DEFINED TRUE) |  | ||||||
|   function(SDL_Preseed_CMakeCache) |   function(SDL_Preseed_CMakeCache) | ||||||
|     set(COMPILER_SUPPORTS_FDIAGNOSTICS_COLOR_ALWAYS      "1"   CACHE INTERNAL "Test COMPILER_SUPPORTS_FDIAGNOSTICS_COLOR_ALWAYS") |     set(COMPILER_SUPPORTS_FDIAGNOSTICS_COLOR_ALWAYS      "1"   CACHE INTERNAL "Test COMPILER_SUPPORTS_FDIAGNOSTICS_COLOR_ALWAYS") | ||||||
|     set(HAVE_ALLOCA_H                                    "1"   CACHE INTERNAL "Have include alloca.h") |     set(HAVE_ALLOCA_H                                    "1"   CACHE INTERNAL "Have include alloca.h") | ||||||
| @@ -177,4 +174,3 @@ if(SDL_EMSCRIPTEN_PRESEED) | |||||||
|     set(HAVE_DLOPEN_IN_LIBC                              "1"   CACHE INTERNAL "Have symbol dlopen") |     set(HAVE_DLOPEN_IN_LIBC                              "1"   CACHE INTERNAL "Have symbol dlopen") | ||||||
|   endfunction() |   endfunction() | ||||||
| endif() | endif() | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,7 +1,4 @@ | |||||||
| cmake_dependent_option(SDL_MSVC_PRESEED "Preseed CMake cache for MSVC to speed up configuration" ON "MSVC;NOT WINDOWS_STORE" OFF) | if(MSVC) | ||||||
|  |  | ||||||
| if(SDL_MSVC_PRESEED) |  | ||||||
|   set(SDL_PRESEED_FUNCTION_DEFINED TRUE) |  | ||||||
|   function(SDL_Preseed_CMakeCache) |   function(SDL_Preseed_CMakeCache) | ||||||
|     set(COMPILER_SUPPORTS_FDIAGNOSTICS_COLOR_ALWAYS      ""    CACHE INTERNAL "Test COMPILER_SUPPORTS_FDIAGNOSTICS_COLOR_ALWAYS") |     set(COMPILER_SUPPORTS_FDIAGNOSTICS_COLOR_ALWAYS      ""    CACHE INTERNAL "Test COMPILER_SUPPORTS_FDIAGNOSTICS_COLOR_ALWAYS") | ||||||
|     set(HAVE_ALLOCA_H                                    ""    CACHE INTERNAL "Have include alloca.h") |     set(HAVE_ALLOCA_H                                    ""    CACHE INTERNAL "Have include alloca.h") | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user