cmake: Don't have modules to depend on libvlc on non-win32 platform.
authorPierre d'Herbemont <pdherbemont@videolan.org>
Mon, 4 Feb 2008 14:00:39 +0000 (14:00 +0000)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Mon, 4 Feb 2008 14:00:39 +0000 (14:00 +0000)
extras/buildsystem/cmake/include/config.cmake
extras/buildsystem/cmake/include/vlc_module_funcs.cmake

index 308b060..ef7fb62 100644 (file)
@@ -94,6 +94,12 @@ include( ${CMAKE_SOURCE_DIR}/cmake/vlc_test_inline.cmake )
 if(APPLE)
     include( ${CMAKE_SOURCE_DIR}/cmake/vlc_find_frameworks.cmake )
 
+    set(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS
+            "${CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS} -undefined dynamic_lookup")
+        set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
+            "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS} -undefined dynamic_lookup")
+    MESSAGE( "Using ${CMAKE_SHARED_MODULE_LINK_C_FLAGS}" )
+
     set(HAVE_DL_DYLD ON INTERNAL)
     set(SYS_DARWIN 1)
 
index 9336676..cd96b6e 100644 (file)
@@ -3,11 +3,14 @@ include( ${CMAKE_SOURCE_DIR}/cmake/vlc_add_compile_flag.cmake )
 MACRO(vlc_add_module module_name)
     if(ENABLE_VLC_MODULE_${module_name})
         add_library( vlc_${module_name} MODULE ${ARGN} )
-        set_target_properties( vlc_${module_name} PROPERTIES COMPILE_FLAGS "-D__PLUGIN__ -DMODULE_NAME=${module_name} -DMODULE_NAME_IS_${module_name} -I${CMAKE_CURRENT_SOURCE_DIR}" )
+       # On win32 we need to have all the symbol resolved at link time
+        if(WIN32)
+            set(VLC_${module_name}_LINK_LIBRARIES "VLC_${module_name}_LINK_LIBRARIES libvlc")
+        endif(WIN32)
+        set_target_properties( vlc_${module_name} PROPERTIES COMPILE_FLAGS
+                "-D__PLUGIN__ -DMODULE_NAME=${module_name} -DMODULE_NAME_IS_${module_name} -I${CMAKE_CURRENT_SOURCE_DIR}" )
         if (VLC_${module_name}_LINK_LIBRARIES)
-            target_link_libraries( vlc_${module_name} libvlc ${VLC_${module_name}_LINK_LIBRARIES})
-        else (VLC_${module_name}_LINK_LIBRARIES)
-            target_link_libraries( vlc_${module_name} libvlc )
+            target_link_libraries( vlc_${module_name} ${VLC_${module_name}_LINK_LIBRARIES})
         endif (VLC_${module_name}_LINK_LIBRARIES)
     endif(ENABLE_VLC_MODULE_${module_name})
 ENDMACRO(vlc_add_module)