<div dir="ltr">From 2f8cd317145279741997f602b3a6b3738240c149 Mon Sep 17 00:00:00 2001<br>From: lwWang <<a href="mailto:liwei@multicorewareinc.com">liwei@multicorewareinc.com</a>><br>Date: Fri, 15 Oct 2021 14:00:23 +0800<br>Subject: [PATCH] fix the getopt issue on some MAC<br><br>---<br> source/CMakeLists.txt | 6 +++---<br> 1 file changed, 3 insertions(+), 3 deletions(-)<br><br>diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt<br>index ad46614d2..c5166f890 100755<br>--- a/source/CMakeLists.txt<br>+++ b/source/CMakeLists.txt<br>@@ -748,14 +748,14 @@ if(ENABLE_CLI)<br>     source_group(input FILES ${InputFiles})<br>     source_group(output FILES ${OutputFiles})<br> <br>-    check_include_files(getopt.h HAVE_GETOPT_H)<br>-    if(NOT HAVE_GETOPT_H)<br>+    check_function_exists(getopt HAVE_GETOPT)<br>+    if(NOT HAVE_GETOPT)<br>         if(MSVC)<br>             set_source_files_properties(compat/getopt/getopt.c PROPERTIES COMPILE_FLAGS "/wd4100 /wd4131 -DHAVE_STRING_H=1")<br>         endif(MSVC)<br>         include_directories(compat/getopt)<br>         set(GETOPT compat/getopt/getopt.c compat/getopt/getopt.h)<br>-    endif(NOT HAVE_GETOPT_H)<br>+    endif(NOT HAVE_GETOPT)<br>     if(WIN32)<br>         set(ExportDefs "${PROJECT_BINARY_DIR}/x265.def")<br>     endif(WIN32)<br>-- <br>2.22.0.windows.1<br><br></div>