Browse Source

[MERGE #185] Cross Platform: Compiles on OSX

Merge pull request #185 from jkrems:jk-linux-and-osx
Mostly wanted to document how to compile it on OSX without [a VM](http://ariya.ofilabs.com/2016/01/playing-with-chakracore-on-linux.html).

I didn't do any testing on this, this is purely an "it compiles". But maybe it could be helpful to others.
Jianchun Xu 10 years ago
parent
commit
e4ddeb55b8
1 changed files with 9 additions and 1 deletions
  1. 9 1
      CMakeLists.txt

+ 9 - 1
CMakeLists.txt

@@ -18,9 +18,17 @@ if(CMAKE_SYSTEM_NAME STREQUAL Linux)
         clr_unknown_arch()
     endif()
     set(CLR_CMAKE_PLATFORM_LINUX 1)
+elseif(CMAKE_SYSTEM_NAME STREQUAL Darwin)
+    set(CLR_CMAKE_PLATFORM_UNIX 1)
+    if(CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64)
+        set(CLR_CMAKE_PLATFORM_UNIX_TARGET_AMD64 1)
+    else()
+        clr_unknown_arch()
+    endif()
+    set(CLR_CMAKE_PLATFORM_DARWIN 1)
 else()
     clr_unknown_arch()
-endif (CMAKE_SYSTEM_NAME STREQUAL Linux)
+endif()
 
 if(CLR_CMAKE_PLATFORM_UNIX_TARGET_AMD64)
   set(CLR_CMAKE_PLATFORM_ARCH_AMD64 1)