Skip to content

Commit

Permalink
Detect cygwin or foreign OSes
Browse files Browse the repository at this point in the history
  • Loading branch information
vkalintiris committed Apr 18, 2024
1 parent 4250aef commit 8302ced
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 9 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,20 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
elseif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
set(FREEBSD True)
set(COMPILED_FOR_FREEBSD True)
else()
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(LINUX True)
set(COMPILED_FOR_LINUX True)
add_definitions(-D_GNU_SOURCE)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Cygwin")
set(CYGWIN True)
set(COMPILED_FOR_CYGWIN True)
else()
set(FOREIGN_OS True)
set(COMPILED_FOR_FOREIGN_OS True)
endif()

message(INFO "Detected CMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}")

#
# Libm
#
Expand Down
2 changes: 2 additions & 0 deletions packaging/cmake/config.cmake.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#cmakedefine COMPILED_FOR_FREEBSD
#cmakedefine COMPILED_FOR_LINUX
#cmakedefine COMPILED_FOR_MACOS
#cmakedefine COMPILED_FOR_CYGWIN
#cmakedefine COMPILED_FOR_FOREIGN_OS

// checked headers

Expand Down

0 comments on commit 8302ced

Please sign in to comment.