Check if the current operating system is linux

This commit is contained in:
slguan 2019-07-12 14:07:46 +08:00
parent cffe218533
commit bf74e8d6b1
1 changed files with 4 additions and 1 deletions

View File

@ -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