Fix emulators/hatari pre-emptively for CMake 3.11. Build error is

CMake Error at /usr/local/share/cmake/Modules/CheckIncludeFiles.cmake:63 (message):
  Unknown arguments:

    HAVE_SDL_CONFIG_H

which comes because SDL_INCLUDE_DIR can contain more than one element,
in which case the code falls over. Further explanation is in the patch.

Approved by:	tcberner (mentor, implicit)
This commit is contained in:
Adriaan de Groot 2018-03-20 22:52:50 +00:00
parent a65f5a2eb9
commit 28ef36f784
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=465137
2 changed files with 21 additions and 1 deletions

View File

@ -3,7 +3,7 @@
PORTNAME= hatari
PORTVERSION= 2.0.0
PORTREVISION= 3
PORTREVISION= 4
CATEGORIES= emulators
MASTER_SITES= http://download.tuxfamily.org/hatari/${PORTVERSION}/

View File

@ -0,0 +1,20 @@
${SDL_INCLUDE_DIR} can contain more than one directory,
so using it here as if it is a single directory can confuse
check_include_files. Instead, iterate over it.
--- CMakeLists.txt.orig 2018-03-20 22:30:14.014771000 +0000
+++ CMakeLists.txt 2018-03-20 22:31:23.332802000 +0000
@@ -187,7 +187,12 @@
check_include_files(termios.h HAVE_TERMIOS_H)
check_include_files(strings.h HAVE_STRINGS_H)
check_include_files(malloc.h HAVE_MALLOC_H)
-check_include_files(${SDL_INCLUDE_DIR}/SDL_config.h HAVE_SDL_CONFIG_H)
+foreach(_sid ${SDL_INCLUDE_DIR})
+ check_include_files(${_sid}/SDL_config.h HAVE_SDL_CONFIG_H)
+ if(HAVE_SDL_CONFIG_H)
+ break()
+ endif()
+endforeach()
check_include_files(sys/time.h HAVE_SYS_TIME_H)
check_include_files(sys/times.h HAVE_SYS_TIMES_H)
check_include_files(utime.h HAVE_UTIME_H)