From bf74e8d6b19b89147be872a9407312a2cb361f31 Mon Sep 17 00:00:00 2001 From: slguan Date: Fri, 12 Jul 2019 14:07:46 +0800 Subject: [PATCH] Check if the current operating system is linux --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bc3314e8ee..e19b5e0abc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,8 +15,11 @@ SET(CMAKE_VERBOSE_MAKEFILE ON) ADD_DEFINITIONS(-D_REENTRANT -D_M_X64 -D__USE_POSIX -D_LIBC_REENTRANT) #set macro definitions according to os platform -IF (${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR UNIX) +IF (${CMAKE_SYSTEM_NAME} MATCHES "Linux") ADD_DEFINITIONS(-DLINUX -D_LINUX) +ELSE () + MESSAGE(FATAL_ERROR "The current system is not linux, stop compile") + EXIT () ENDIF () #set debug & release related options