Fix SOS command to not break the OSX build, and be linkable against apples LLDB.framework
authorGeoff Norton <grompf@gmail.com>
Sat, 21 Feb 2015 01:16:31 +0000 (17:16 -0800)
committerGeoff Norton <grompf@gmail.com>
Sat, 21 Feb 2015 01:16:31 +0000 (17:16 -0800)
src/ToolBox/SOS/lldbplugin/CMakeLists.txt
src/dlls/mscordac/CMakeLists.txt

index 78046ec..614e982 100644 (file)
@@ -21,7 +21,6 @@ if((NOT ${LLDB_INCLUDE_DIR} STREQUAL "") AND (NOT ${LLDB_LIB_DIR} STREQUAL ""))
 
     include_directories(inc)
     include_directories("${LLDB_INCLUDE_DIR}")
-    link_directories("${LLDB_LIB_DIR}")
 
     set(SOURCES
         sosplugin.cpp
@@ -32,6 +31,15 @@ if((NOT ${LLDB_INCLUDE_DIR} STREQUAL "") AND (NOT ${LLDB_LIB_DIR} STREQUAL ""))
     add_library(sosplugin SHARED ${SOURCES})
     add_dependencies(sosplugin sos)
 
+    if(CLR_CMAKE_PLATFORM_LINUX)
+        link_directories("${LLDB_LIB_DIR}")
+    endif(CLR_CMAKE_PLATFORM_LINUX)
+
+    if(CLR_CMAKE_PLATFORM_DARWIN)
+        find_library(LLDB LLDB PATHS ${LLDB_LIB_DIR})
+        target_link_libraries(sosplugin ${LLDB})
+    endif(CLR_CMAKE_PLATFORM_DARWIN)
+
     # add the install targets
     install (TARGETS sosplugin DESTINATION .)
-endif()
\ No newline at end of file
+endif()
index fc0836f..8e11906 100644 (file)
@@ -30,14 +30,16 @@ if(WIN32)
     set(START_LIBRARY_GROUP)
     set(END_LIBRARY_GROUP)
 else(WIN32)
-    # This option is necessary to ensure that the overloaded delete operator defined inside
-    # of the utilcode will be used instead of the standard library delete operator.
-    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Xlinker -Bsymbolic-functions")
-
-    # The following linked options can be inserted into the linker libraries list to 
-    # ensure proper resolving of circular references between a subset of the libraries.
-    set(START_LIBRARY_GROUP -Wl,--start-group)
-    set(END_LIBRARY_GROUP -Wl,--end-group)
+    if(CLR_CMAKE_PLATFORM_LINUX)
+        # This option is necessary to ensure that the overloaded delete operator defined inside
+        # of the utilcode will be used instead of the standard library delete operator.
+        set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Xlinker -Bsymbolic-functions")
+
+        # The following linked options can be inserted into the linker libraries list to 
+        # ensure proper resolving of circular references between a subset of the libraries.
+        set(START_LIBRARY_GROUP -Wl,--start-group)
+        set(END_LIBRARY_GROUP -Wl,--end-group)
+    endif(CLR_CMAKE_PLATFORM_LINUX)
 endif(WIN32)
 
 add_library(mscordaccore SHARED ${CLR_DAC_SOURCES})