mirror of
https://github.com/GerbilSoft/rom-properties.git
synced 2025-06-19 03:55:43 -04:00

It's a bit more restrictive than rp-download, since rpcli doesn't need to access the Internet. Moved Win32 security option initialization to an os-secure file as well for consistency. Moved the OpenBSD pledge()/tame() check to a CMake macro file.
26 lines
910 B
CMake
26 lines
910 B
CMake
# Check if OpenBSD's pledge() syscall is available, and if so,
|
|
# which variant of pledge() or tame() is available.
|
|
#
|
|
# The following cache variables are set:
|
|
# - HAVE_TAME: tame() is available. (OpenBSD 5.8)
|
|
# - HAVE_PLEDGE: pledge() is available, (OpenBSD 5.9+)
|
|
# - HAVE_PLEDGE_EXECPROMISES: pledge() with execpromises is available. (OpenBSD 6.3+)
|
|
|
|
MACRO(CHECK_OPENBSD_PLEDGE)
|
|
CHECK_SYMBOL_EXISTS(pledge "unistd.h" HAVE_PLEDGE)
|
|
IF(NOT HAVE_PLEDGE)
|
|
CHECK_SYMBOL_EXISTS(pledge "sys/tame.h" HAVE_TAME)
|
|
ENDIF(NOT HAVE_PLEDGE)
|
|
IF(HAVE_PLEDGE)
|
|
# pledge() has a different syntax in OpenBSD 6.3 and later:
|
|
# - 5.9-6.2: pledge(const char *promises, const char *paths[])
|
|
# - 6.3+: pledge(const char *promises, const char *execpromises)
|
|
CHECK_C_SOURCE_COMPILES("
|
|
#include <unistd.h>
|
|
int main(void)
|
|
{
|
|
pledge(\"\", \"\");
|
|
}" HAVE_PLEDGE_EXECPROMISES)
|
|
ENDIF(HAVE_PLEDGE)
|
|
ENDMACRO(CHECK_OPENBSD_PLEDGE)
|