mirror of
https://github.com/Z3Prover/z3
synced 2025-04-06 01:24:08 +00:00
Remove all per-OS defines apart from _WINDOWS.
These are all unused and shouldn't be needed. Mostly we need something for differentiating between POSIX and non-POSIX (until we can reduce some of those differences as well). We shouldn't need to modify the build system to build on a new OS if it is basically a Unix and is supported by cmake.
This commit is contained in:
parent
85b96dc877
commit
dc75031a36
|
@ -178,32 +178,10 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|||
################################################################################
|
||||
# Platform detection
|
||||
################################################################################
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
message(STATUS "Platform: Linux")
|
||||
list(APPEND Z3_COMPONENT_CXX_DEFINES "-D_LINUX_")
|
||||
elseif (CMAKE_SYSTEM_NAME STREQUAL "Android")
|
||||
message(STATUS "Platform: Android")
|
||||
list(APPEND Z3_COMPONENT_CXX_DEFINES "-D_ANDROID_")
|
||||
elseif (CMAKE_SYSTEM_NAME MATCHES "GNU")
|
||||
message(STATUS "Platform: GNU/Hurd")
|
||||
list(APPEND Z3_COMPONENT_CXX_DEFINES "-D_HURD_")
|
||||
elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||
if (TARGET_ARCHITECTURE STREQUAL "arm64")
|
||||
set(CMAKE_OSX_ARCHITECTURES "arm64")
|
||||
endif()
|
||||
message(STATUS "Platform: Darwin")
|
||||
elseif (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
|
||||
message(STATUS "Platform: FreeBSD")
|
||||
list(APPEND Z3_COMPONENT_CXX_DEFINES "-D_FREEBSD_")
|
||||
elseif (CMAKE_SYSTEM_NAME MATCHES "NetBSD")
|
||||
message(STATUS "Platform: NetBSD")
|
||||
list(APPEND Z3_COMPONENT_CXX_DEFINES "-D_NetBSD_")
|
||||
elseif (CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
|
||||
message(STATUS "Platform: OpenBSD")
|
||||
list(APPEND Z3_COMPONENT_CXX_DEFINES "-D_OPENBSD_")
|
||||
elseif (CYGWIN)
|
||||
message(STATUS "Platform: Cygwin")
|
||||
list(APPEND Z3_COMPONENT_CXX_DEFINES "-D_CYGWIN")
|
||||
elseif (WIN32)
|
||||
message(STATUS "Platform: Windows")
|
||||
list(APPEND Z3_COMPONENT_CXX_DEFINES "-D_WINDOWS")
|
||||
|
@ -216,8 +194,6 @@ elseif (EMSCRIPTEN)
|
|||
"-s DISABLE_EXCEPTION_CATCHING=0"
|
||||
"-s ERROR_ON_UNDEFINED_SYMBOLS=1"
|
||||
)
|
||||
else()
|
||||
message(FATAL_ERROR "Platform \"${CMAKE_SYSTEM_NAME}\" not recognised")
|
||||
endif()
|
||||
|
||||
list(APPEND Z3_COMPONENT_EXTRA_INCLUDE_DIRS
|
||||
|
|
|
@ -2594,46 +2594,30 @@ def mk_config():
|
|||
SO_EXT = '.dylib'
|
||||
SLIBFLAGS = '-dynamiclib'
|
||||
elif sysname == 'Linux':
|
||||
CXXFLAGS = '%s -D_LINUX_' % CXXFLAGS
|
||||
OS_DEFINES = '-D_LINUX_'
|
||||
SO_EXT = '.so'
|
||||
SLIBFLAGS = '-shared'
|
||||
SLIBEXTRAFLAGS = '%s -Wl,-soname,libz3.so' % SLIBEXTRAFLAGS
|
||||
elif sysname == 'GNU':
|
||||
CXXFLAGS = '%s -D_HURD_' % CXXFLAGS
|
||||
OS_DEFINES = '-D_HURD_'
|
||||
SO_EXT = '.so'
|
||||
SLIBFLAGS = '-shared'
|
||||
elif sysname == 'FreeBSD':
|
||||
CXXFLAGS = '%s -D_FREEBSD_' % CXXFLAGS
|
||||
OS_DEFINES = '-D_FREEBSD_'
|
||||
SO_EXT = '.so'
|
||||
SLIBFLAGS = '-shared'
|
||||
SLIBEXTRAFLAGS = '%s -Wl,-soname,libz3.so' % SLIBEXTRAFLAGS
|
||||
elif sysname == 'NetBSD':
|
||||
CXXFLAGS = '%s -D_NETBSD_' % CXXFLAGS
|
||||
OS_DEFINES = '-D_NETBSD_'
|
||||
SO_EXT = '.so'
|
||||
SLIBFLAGS = '-shared'
|
||||
elif sysname == 'OpenBSD':
|
||||
CXXFLAGS = '%s -D_OPENBSD_' % CXXFLAGS
|
||||
OS_DEFINES = '-D_OPENBSD_'
|
||||
SO_EXT = '.so'
|
||||
SLIBFLAGS = '-shared'
|
||||
elif sysname == 'SunOS':
|
||||
CXXFLAGS = '%s -D_SUNOS_' % CXXFLAGS
|
||||
OS_DEFINES = '-D_SUNOS_'
|
||||
SO_EXT = '.so'
|
||||
SLIBFLAGS = '-shared'
|
||||
SLIBEXTRAFLAGS = '%s -mimpure-text' % SLIBEXTRAFLAGS
|
||||
elif sysname.startswith('CYGWIN'):
|
||||
CXXFLAGS = '%s -D_CYGWIN' % CXXFLAGS
|
||||
OS_DEFINES = '-D_CYGWIN'
|
||||
SO_EXT = '.dll'
|
||||
SLIBFLAGS = '-shared'
|
||||
elif sysname.startswith('MSYS_NT') or sysname.startswith('MINGW'):
|
||||
CXXFLAGS = '%s -D_MINGW' % CXXFLAGS
|
||||
OS_DEFINES = '-D_MINGW'
|
||||
SO_EXT = '.dll'
|
||||
SLIBFLAGS = '-shared'
|
||||
EXE_EXT = '.exe'
|
||||
|
|
Loading…
Reference in a new issue