Spaces:
Running
Running
cmake : noramlize case (#1129)
Browse files- CMakeLists.txt +14 -14
CMakeLists.txt
CHANGED
|
@@ -330,39 +330,39 @@ add_compile_definitions(_XOPEN_SOURCE=600)
|
|
| 330 |
# Somehow in OpenBSD whenever POSIX conformance is specified
|
| 331 |
# some string functions rely on locale_t availability,
|
| 332 |
# which was introduced in POSIX.1-2008, forcing us to go higher
|
| 333 |
-
|
| 334 |
remove_definitions(-D_XOPEN_SOURCE=600)
|
| 335 |
add_compile_definitions(_XOPEN_SOURCE=700)
|
| 336 |
-
|
| 337 |
|
| 338 |
# Data types, macros and functions related to controlling CPU affinity
|
| 339 |
# are available on Linux through GNU extensions in libc
|
| 340 |
-
|
| 341 |
add_compile_definitions(_GNU_SOURCE)
|
| 342 |
-
|
| 343 |
|
| 344 |
# RLIMIT_MEMLOCK came in BSD, is not specified in POSIX.1,
|
| 345 |
# and on macOS its availability depends on enabling Darwin extensions
|
| 346 |
# similarly on DragonFly, enabling BSD extensions is necessary
|
| 347 |
-
|
| 348 |
add_compile_definitions(_DARWIN_C_SOURCE)
|
| 349 |
-
|
| 350 |
-
|
| 351 |
add_compile_definitions(_DARWIN_C_SOURCE)
|
| 352 |
-
|
| 353 |
|
| 354 |
# alloca is a non-standard interface that is not visible on BSDs when
|
| 355 |
# POSIX conformance is specified, but not all of them provide a clean way
|
| 356 |
# to enable it in such cases
|
| 357 |
-
|
| 358 |
add_compile_definitions(__BSD_VISIBLE)
|
| 359 |
-
|
| 360 |
-
|
| 361 |
add_compile_definitions(_NETBSD_SOURCE)
|
| 362 |
-
|
| 363 |
-
|
| 364 |
add_compile_definitions(_BSD_SOURCE)
|
| 365 |
-
|
| 366 |
|
| 367 |
if (WHISPER_PERF)
|
| 368 |
set(WHISPER_EXTRA_FLAGS ${WHISPER_EXTRA_FLAGS} -DGGML_PERF)
|
|
|
|
| 330 |
# Somehow in OpenBSD whenever POSIX conformance is specified
|
| 331 |
# some string functions rely on locale_t availability,
|
| 332 |
# which was introduced in POSIX.1-2008, forcing us to go higher
|
| 333 |
+
if (CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
|
| 334 |
remove_definitions(-D_XOPEN_SOURCE=600)
|
| 335 |
add_compile_definitions(_XOPEN_SOURCE=700)
|
| 336 |
+
endif()
|
| 337 |
|
| 338 |
# Data types, macros and functions related to controlling CPU affinity
|
| 339 |
# are available on Linux through GNU extensions in libc
|
| 340 |
+
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
| 341 |
add_compile_definitions(_GNU_SOURCE)
|
| 342 |
+
endif()
|
| 343 |
|
| 344 |
# RLIMIT_MEMLOCK came in BSD, is not specified in POSIX.1,
|
| 345 |
# and on macOS its availability depends on enabling Darwin extensions
|
| 346 |
# similarly on DragonFly, enabling BSD extensions is necessary
|
| 347 |
+
if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
| 348 |
add_compile_definitions(_DARWIN_C_SOURCE)
|
| 349 |
+
endif()
|
| 350 |
+
if (CMAKE_SYSTEM_NAME MATCHES "DragonFly")
|
| 351 |
add_compile_definitions(_DARWIN_C_SOURCE)
|
| 352 |
+
endif()
|
| 353 |
|
| 354 |
# alloca is a non-standard interface that is not visible on BSDs when
|
| 355 |
# POSIX conformance is specified, but not all of them provide a clean way
|
| 356 |
# to enable it in such cases
|
| 357 |
+
if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
|
| 358 |
add_compile_definitions(__BSD_VISIBLE)
|
| 359 |
+
endif()
|
| 360 |
+
if (CMAKE_SYSTEM_NAME MATCHES "NetBSD")
|
| 361 |
add_compile_definitions(_NETBSD_SOURCE)
|
| 362 |
+
endif()
|
| 363 |
+
if (CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
|
| 364 |
add_compile_definitions(_BSD_SOURCE)
|
| 365 |
+
endif()
|
| 366 |
|
| 367 |
if (WHISPER_PERF)
|
| 368 |
set(WHISPER_EXTRA_FLAGS ${WHISPER_EXTRA_FLAGS} -DGGML_PERF)
|