mirror of
				https://github.com/Ryujinx/SDL.git
				synced 2025-11-04 15:04:51 +00:00 
			
		
		
		
	cmake: check for math library functions even in the absence of libm
(Reference issue: https://github.com/libsdl-org/SDL/issues/7011)
This commit is contained in:
		
							parent
							
								
									305e7b55bd
								
							
						
					
					
						commit
						0d5467a6e9
					
				| 
						 | 
				
			
			@ -1048,6 +1048,7 @@ if(SDL_LIBC)
 | 
			
		|||
    check_library_exists(m pow "" HAVE_LIBM)
 | 
			
		||||
    if(HAVE_LIBM)
 | 
			
		||||
      set(CMAKE_REQUIRED_LIBRARIES m)
 | 
			
		||||
    endif()
 | 
			
		||||
    foreach(_FN
 | 
			
		||||
              atan atan2 atanf atan2f ceil ceilf copysign copysignf cos cosf
 | 
			
		||||
              exp expf fabs fabsf floor floorf fmod fmodf log logf log10 log10f
 | 
			
		||||
| 
						 | 
				
			
			@ -1057,6 +1058,7 @@ if(SDL_LIBC)
 | 
			
		|||
        set(_HAVEVAR "HAVE_${_UPPER}")
 | 
			
		||||
        check_symbol_exists("${_FN}" "math.h" ${_HAVEVAR})
 | 
			
		||||
    endforeach()
 | 
			
		||||
    if(HAVE_LIBM)
 | 
			
		||||
      set(CMAKE_REQUIRED_LIBRARIES)
 | 
			
		||||
      if(NOT VITA)
 | 
			
		||||
        list(APPEND EXTRA_LIBS m)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue