summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorGeoff Norton <grompf@gmail.com>2015-02-03 21:18:43 -0800
committerGeoff Norton <grompf@gmail.com>2015-02-06 16:24:36 -0800
commit495c00ff2353f1bf49e085c646fdd4b4ec658bba (patch)
tree4c7937a9b002578dcf4835d55dcbc52901f7d184 /CMakeLists.txt
parenta85beebc633d373bf3df4241ce7f86d76d7690ec (diff)
downloadcoreclr-495c00ff2353f1bf49e085c646fdd4b4ec658bba.tar.gz
coreclr-495c00ff2353f1bf49e085c646fdd4b4ec658bba.tar.bz2
coreclr-495c00ff2353f1bf49e085c646fdd4b4ec658bba.zip
Initial Mac OSX Support
Supports building up the VM, PAL and various components on Mac OSX 10.10 There are some oddities with the Apple assembler not generating short jumps and not supporting 1 byte relocs.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt23
1 files changed, 19 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index aa0ad09ef8..56e4ee84cc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,8 +7,16 @@ project(CoreCLR)
if(CMAKE_SYSTEM_NAME STREQUAL Linux)
set(CLR_CMAKE_PLATFORM_UNIX 1)
set(CLR_CMAKE_PLATFORM_UNIX_TARGET_AMD64 1)
+ set(CLR_CMAKE_PLATFORM_LINUX 1)
endif(CMAKE_SYSTEM_NAME STREQUAL Linux)
+if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
+ set(CLR_CMAKE_PLATFORM_UNIX 1)
+ set(CLR_CMAKE_PLATFORM_UNIX_TARGET_AMD64 1)
+ set(CLR_CMAKE_PLATFORM_DARWIN 1)
+ set(CMAKE_ASM_COMPILE_OBJECT "${CMAKE_C_COMPILER} <FLAGS> <DEFINES> -o <OBJECT> -c <SOURCE>")
+endif(CMAKE_SYSTEM_NAME STREQUAL Darwin)
+
# Build a list of compiler definitions by putting -D in front of each define.
function(get_compile_definitions DefinitionName)
# Get the current list of definitions
@@ -126,7 +134,7 @@ if (WIN32)
endif (CMAKE_SYSTEM_PROCESSOR STREQUAL AMD64)
elseif (CLR_CMAKE_PLATFORM_UNIX)
- # Set flag to indicate if this will be a 64bit Linux build
+ # Set flag to indicate if this will be a 64bit build
if(CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64)
set(IS_64BIT_BUILD 1)
endif (CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64)
@@ -285,17 +293,24 @@ endif (WIN32)
if (CLR_CMAKE_PLATFORM_UNIX)
add_definitions(-DPLATFORM_UNIX=1)
- add_definitions(-D__LINUX__=1)
add_definitions(-DFEATURE_PAL_SXS)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64)
- message("Detected Linux x86_64")
- add_definitions(-DLINUX64)
add_definitions(-DBIT64=1)
add_definitions(-DFEATURE_PAL)
else (CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64)
message(FATAL_ERROR "error: Detected non x86_64 target processor. Not supported!")
endif(CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64)
+
+ if(CLR_CMAKE_PLATFORM_LINUX)
+ add_definitions(-D__LINUX__=1)
+ message("Detected Linux x86_64")
+ add_definitions(-DLINUX64)
+ endif(CLR_CMAKE_PLATFORM_LINUX)
+ if(CLR_CMAKE_PLATFORM_DARWIN)
+ message("Detected OSX x86_64")
+ add_definitions(-D_XOPEN_SOURCE)
+ endif(CLR_CMAKE_PLATFORM_DARWIN)
endif(CLR_CMAKE_PLATFORM_UNIX)