Przeglądaj źródła

Renamed IOS and Mac OS X framework macros.

These macros may be used later not just to setup frameworks but also
other linker flags.

Renamed setup_ios_frameworks    -> setup_ios_linker_flags.
Renamed setup_macosx_frameworks -> setup_macosx_linker_flags.
weitjong 12 lat temu
rodzic
commit
633a7f4804

+ 10 - 8
Source/CMake/Modules/Urho3D-CMake-magic.cmake

@@ -373,14 +373,16 @@ macro (setup_executable)
     endif ()
 endmacro ()
 
-# Macro for setting up linker flags to link against the framework for Mac OS X desktop build
-macro (setup_macosx_framework FRAMEWORKS)
-    set (${FRAMEWORKS} "-framework AudioUnit -framework Carbon -framework Cocoa -framework CoreAudio -framework ForceFeedback -framework IOKit -framework OpenGL -framework CoreServices")
+# Macro for setting up linker flags for Mac OS X desktop build
+macro (setup_macosx_linker_flags LINKER_FLAGS)
+    # Framework list to link against 
+    set (${LINKER_FLAGS} "-framework AudioUnit -framework Carbon -framework Cocoa -framework CoreAudio -framework ForceFeedback -framework IOKit -framework OpenGL -framework CoreServices")
 endmacro ()
 
-# Macro for setting up linker flags to link against the framework for IOS build
-macro (setup_ios_framework FRAMEWORKS)
-    set (${FRAMEWORKS} "-framework AudioToolbox -framework CoreAudio -framework CoreGraphics -framework Foundation -framework OpenGLES -framework QuartzCore -framework UIKit")
+# Macro for setting up linker flags for IOS build
+macro (setup_ios_linker_flags LINKER_FLAGS)
+    # Framework list to link against 
+    set (${LINKER_FLAGS} "-framework AudioToolbox -framework CoreAudio -framework CoreGraphics -framework Foundation -framework OpenGLES -framework QuartzCore -framework UIKit")
 endmacro ()
 
 # Macro for setting up an executable target with resources to copy
@@ -431,9 +433,9 @@ macro (setup_main_executable)
             set (EXE_TYPE WIN32)
         elseif (IOS)
             set (EXE_TYPE MACOSX_BUNDLE)
-            setup_ios_framework (CMAKE_EXE_LINKER_FLAGS)
+            setup_ios_linker_flags (CMAKE_EXE_LINKER_FLAGS)
         elseif (APPLE)
-            setup_macosx_framework (CMAKE_EXE_LINKER_FLAGS)
+            setup_macosx_linker_flags (CMAKE_EXE_LINKER_FLAGS)
         endif ()
         setup_executable ()
     endif ()

+ 6 - 2
Source/Engine/CMakeLists.txt

@@ -123,8 +123,12 @@ endif ()
 
 # Setup the frameworks for Mac OS X platform
 if (APPLE AND LIB_TYPE STREQUAL SHARED)
-    setup_macosx_framework (FRAMEWORKS)
-    set_target_properties (${TARGET_NAME} PROPERTIES LINK_FLAGS ${FRAMEWORKS})
+    if (IOS)
+        setup_ios_linker_flags (LINKER_FLAGS)
+    else ()
+        setup_macosx_linker_flags (LINKER_FLAGS)
+    endif ()
+    set_target_properties (${TARGET_NAME} PROPERTIES LINK_FLAGS ${LINKER_FLAGS})
 endif ()
 
 # Define post build steps

+ 1 - 1
Source/Tools/AssetImporter/CMakeLists.txt

@@ -34,6 +34,6 @@ set (INCLUDE_DIRS_ONLY ../../ThirdParty/Bullet/src)
 
 # Setup target
 if (APPLE)
-    setup_macosx_framework (CMAKE_EXE_LINKER_FLAGS)
+    setup_macosx_linker_flags (CMAKE_EXE_LINKER_FLAGS)
 endif ()
 setup_executable ()

+ 1 - 1
Source/Tools/ScriptCompiler/CMakeLists.txt

@@ -33,6 +33,6 @@ set (LIBS ../../Engine/Container ../../Engine/Core ../../Engine/Engine ../../Eng
 
 # Setup target
 if (APPLE)
-    setup_macosx_framework (CMAKE_EXE_LINKER_FLAGS)
+    setup_macosx_linker_flags (CMAKE_EXE_LINKER_FLAGS)
 endif ()
 setup_executable ()