Lib unixcoreruncommon
authorKyungwoo Lee <kyulee@microsoft.com>
Wed, 2 Dec 2015 18:24:51 +0000 (10:24 -0800)
committerKyungwoo Lee <kyulee@microsoft.com>
Thu, 3 Dec 2015 14:50:43 +0000 (06:50 -0800)
CMakeLists.txt
src/coreclr/hosts/unixcoreconsole/CMakeLists.txt
src/coreclr/hosts/unixcorerun/CMakeLists.txt
src/coreclr/hosts/unixcoreruncommon/CMakeLists.txt [new file with mode: 0644]
src/coreclr/hosts/unixcoreruncommon/coreruncommon.cpp
src/coreclr/hosts/unixcoreruncommon/coreruncommon.h

index 80625f9..d0720ba 100644 (file)
@@ -294,6 +294,7 @@ if (CLR_CMAKE_PLATFORM_UNIX)
   add_subdirectory(src/ToolBox/SOS/lldbplugin)
   add_subdirectory(src/pal)
   add_subdirectory(src/corefx)
+  add_subdirectory(src/coreclr/hosts/unixcoreruncommon)
   add_subdirectory(src/coreclr/hosts/unixcorerun)
   add_subdirectory(src/coreclr/hosts/unixcoreconsole)
 endif(CLR_CMAKE_PLATFORM_UNIX)
index 034f0ea..905ed26 100644 (file)
@@ -3,7 +3,6 @@ project(unixcoreconsole)
 include_directories(../unixcoreruncommon)
 
 set(CORECONSOLE_SOURCES 
-    ../unixcoreruncommon/coreruncommon.cpp
     coreconsole.cpp 
 )
 
@@ -21,6 +20,7 @@ endif(NOT CMAKE_SYSTEM_NAME STREQUAL FreeBSD)
 # Libc turns locks into no-ops if pthread was not loaded into process yet. Loading
 # pthread by the process executable ensures that all locks are initialized properly.
 target_link_libraries(coreconsole
+    unixcoreruncommon
     pthread
 )
 
index 3d5d4d8..d17ca0b 100644 (file)
@@ -3,7 +3,6 @@ project(unixcorerun)
 include_directories(../unixcoreruncommon)
 
 set(CORERUN_SOURCES 
-    ../unixcoreruncommon/coreruncommon.cpp
     corerun.cpp 
 )
 
@@ -21,6 +20,7 @@ endif(NOT CMAKE_SYSTEM_NAME STREQUAL FreeBSD)
 # Libc turns locks into no-ops if pthread was not loaded into process yet. Loading
 # pthread by the process executable ensures that all locks are initialized properly.
 target_link_libraries(corerun
+    unixcoreruncommon
     pthread
 )
 
diff --git a/src/coreclr/hosts/unixcoreruncommon/CMakeLists.txt b/src/coreclr/hosts/unixcoreruncommon/CMakeLists.txt
new file mode 100644 (file)
index 0000000..0a50cd8
--- /dev/null
@@ -0,0 +1,8 @@
+project(unixcoreruncommon)
+
+add_library(unixcoreruncommon
+    STATIC
+    coreruncommon.cpp
+)
+
+target_link_libraries(unixcoreruncommon)
index 1290da3..7159832 100644 (file)
 #include <string>
 #include <string.h>
 #include <sys/stat.h>
-
-#if defined(__APPLE__)
-#include <mach-o/dyld.h>
-static const char * const coreClrDll = "libcoreclr.dylib";
-#else
-static const char * const coreClrDll = "libcoreclr.so";
-#endif
+#include "coreruncommon.h"
 
 #define SUCCEEDED(Status) ((Status) >= 0)
 
index 0ce64de..949b5fd 100644 (file)
@@ -47,3 +47,11 @@ int ExecuteManagedAssembly(
             int managedAssemblyArgc,
             const char** managedAssemblyArgv);
 
+
+#if defined(__APPLE__)
+#include <mach-o/dyld.h>
+static const char * const coreClrDll = "libcoreclr.dylib";
+#else
+static const char * const coreClrDll = "libcoreclr.so";
+#endif
+