-lobjc for Metal support default tip
authorEthan Lee <flibitijibibo@flibitijibibo.com>
Sun, 12 Jan 2020 17:26:54 -0500
changeset 1230 600d972bbd57
parent 1229 3ecd29a50d9d
-lobjc for Metal support
CMakeLists.txt
--- a/CMakeLists.txt	Sun Jan 12 11:39:49 2020 -0500
+++ b/CMakeLists.txt	Sun Jan 12 17:26:54 2020 -0500
@@ -125,6 +125,8 @@
 ENDIF(NOT PROFILE_ARB1_NV)
 IF(NOT PROFILE_METAL)
     ADD_DEFINITIONS(-DSUPPORT_PROFILE_METAL=0)
+ELSE(NOT PROFILE_METAL)
+    SET(LOBJC -lobjc)
 ENDIF(NOT PROFILE_METAL)
 IF(NOT PROFILE_SPIRV)
     ADD_DEFINITIONS(-DSUPPORT_PROFILE_SPIRV=0)
@@ -185,7 +187,7 @@
     )
 ENDIF(COMPILER_SUPPORT)
 IF(BUILD_SHARED)
-    TARGET_LINK_LIBRARIES(mojoshader ${LIBM} ${CARBON_FRAMEWORK})
+    TARGET_LINK_LIBRARIES(mojoshader ${LIBM} ${LOBJC} ${CARBON_FRAMEWORK})
 ENDIF(BUILD_SHARED)
 
 SET_SOURCE_FILES_PROPERTIES(
@@ -211,16 +213,16 @@
 IF(SDL2)
     INCLUDE_DIRECTORIES(${SDL2_INCLUDE_DIR})
     ADD_EXECUTABLE(glcaps utils/glcaps.c)
-    TARGET_LINK_LIBRARIES(glcaps ${SDL2} ${LIBM} ${CARBON_FRAMEWORK})
+    TARGET_LINK_LIBRARIES(glcaps ${SDL2} ${LIBM} ${LOBJC} ${CARBON_FRAMEWORK})
     ADD_EXECUTABLE(bestprofile utils/bestprofile.c)
-    TARGET_LINK_LIBRARIES(bestprofile mojoshader ${SDL2} ${LIBM} ${CARBON_FRAMEWORK})
+    TARGET_LINK_LIBRARIES(bestprofile mojoshader ${SDL2} ${LIBM} ${LOBJC} ${CARBON_FRAMEWORK})
     ADD_EXECUTABLE(availableprofiles utils/availableprofiles.c)
-    TARGET_LINK_LIBRARIES(availableprofiles mojoshader ${SDL2} ${LIBM} ${CARBON_FRAMEWORK})
+    TARGET_LINK_LIBRARIES(availableprofiles mojoshader ${SDL2} ${LIBM} ${LOBJC} ${CARBON_FRAMEWORK})
 ENDIF(SDL2)
 
 IF(COMPILER_SUPPORT)
     ADD_EXECUTABLE(finderrors utils/finderrors.c)
-    TARGET_LINK_LIBRARIES(finderrors mojoshader ${SDL2} ${LIBM} ${CARBON_FRAMEWORK})
+    TARGET_LINK_LIBRARIES(finderrors mojoshader ${SDL2} ${LIBM} ${LOBJC} ${CARBON_FRAMEWORK})
     IF(SDL2)
         SET_SOURCE_FILES_PROPERTIES(
             utils/finderrors.c
@@ -237,15 +239,15 @@
 ENDIF(SPIRV_TOOLS_INCLUDE_DIR AND SPIRV_TOOLS_LIBRARY)
 
 ADD_EXECUTABLE(testparse utils/testparse.c)
-TARGET_LINK_LIBRARIES(testparse mojoshader ${LIBM} ${CARBON_FRAMEWORK})
+TARGET_LINK_LIBRARIES(testparse mojoshader ${LIBM} ${LOBJC} ${CARBON_FRAMEWORK})
 IF(SPIRV_TOOLS_INCLUDE_DIR AND SPIRV_TOOLS_LIBRARY)
     TARGET_LINK_LIBRARIES(testparse ${SPIRV_TOOLS_LIBRARY})
 ENDIF(SPIRV_TOOLS_INCLUDE_DIR AND SPIRV_TOOLS_LIBRARY)
 ADD_EXECUTABLE(testoutput utils/testoutput.c)
-TARGET_LINK_LIBRARIES(testoutput mojoshader ${LIBM} ${CARBON_FRAMEWORK})
+TARGET_LINK_LIBRARIES(testoutput mojoshader ${LIBM} ${LOBJC} ${CARBON_FRAMEWORK})
 IF(COMPILER_SUPPORT)
     ADD_EXECUTABLE(mojoshader-compiler utils/mojoshader-compiler.c)
-    TARGET_LINK_LIBRARIES(mojoshader-compiler mojoshader ${LIBM} ${CARBON_FRAMEWORK})
+    TARGET_LINK_LIBRARIES(mojoshader-compiler mojoshader ${LIBM} ${LOBJC} ${CARBON_FRAMEWORK})
 ENDIF(COMPILER_SUPPORT)
 
 # Unit tests...