CMakeLists.txt
changeset 11324 670978408a10
parent 11323 46861f3fc187
child 11326 ba4fe3686323
equal deleted inserted replaced
11323:46861f3fc187 11324:670978408a10
  1318     list(APPEND EXTRA_LDFLAGS "-mwindows")
  1318     list(APPEND EXTRA_LDFLAGS "-mwindows")
  1319     set(SDL_CFLAGS "${SDL_CFLAGS} -Dmain=SDL_main")
  1319     set(SDL_CFLAGS "${SDL_CFLAGS} -Dmain=SDL_main")
  1320     list(APPEND SDL_LIBS "-lmingw32" "-lSDL2main" "-mwindows")
  1320     list(APPEND SDL_LIBS "-lmingw32" "-lSDL2main" "-mwindows")
  1321   endif()
  1321   endif()
  1322 elseif(APPLE)
  1322 elseif(APPLE)
  1323   # TODO: rework this for proper MacOS X, iOS and Darwin support
  1323   # TODO: rework this all for proper MacOS X, iOS and Darwin support
       
  1324 
       
  1325   # We always need these libs on macOS at the moment.
       
  1326   # !!! FIXME: we need Carbon for some very old API calls in
       
  1327   # !!! FIXME:  src/video/cocoa/SDL_cocoakeyboard.c, but we should figure out
       
  1328   # !!! FIXME:  how to dump those.
       
  1329   if (APPLE AND NOT IOS)
       
  1330     set(SDL_FRAMEWORK_COCOA 1)
       
  1331     set(SDL_FRAMEWORK_CARBON 1)
       
  1332   endif()
  1324 
  1333 
  1325   # Requires the darwin file implementation
  1334   # Requires the darwin file implementation
  1326   if(SDL_FILE)
  1335   if(SDL_FILE)
  1327     file(GLOB EXTRA_SOURCES ${SDL2_SOURCE_DIR}/src/file/cocoa/*.m)
  1336     file(GLOB EXTRA_SOURCES ${SDL2_SOURCE_DIR}/src/file/cocoa/*.m)
  1328     set(SOURCE_FILES ${EXTRA_SOURCES} ${SOURCE_FILES})
  1337     set(SOURCE_FILES ${EXTRA_SOURCES} ${SOURCE_FILES})
  1329     # !!! FIXME: modern CMake doesn't need "LANGUAGE C" for Objective-C.
  1338     # !!! FIXME: modern CMake doesn't need "LANGUAGE C" for Objective-C.
  1330     set_source_files_properties(${EXTRA_SOURCES} PROPERTIES LANGUAGE C)
  1339     set_source_files_properties(${EXTRA_SOURCES} PROPERTIES LANGUAGE C)
  1331     set(HAVE_SDL_FILE TRUE)
  1340     set(HAVE_SDL_FILE TRUE)
  1332     set(SDL_FRAMEWORK_COCOA 1)
  1341     # !!! FIXME: why is COREVIDEO inside this if() block?
  1333     set(SDL_FRAMEWORK_COREVIDEO 1)
  1342     set(SDL_FRAMEWORK_COREVIDEO 1)
  1334   else()
  1343   else()
  1335     message_error("SDL_FILE must be enabled to build on MacOS X")
  1344     message_error("SDL_FILE must be enabled to build on MacOS X")
  1336   endif()
  1345   endif()
  1337 
  1346 
  1381     else()
  1390     else()
  1382       file(GLOB POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/macosx/*.c)
  1391       file(GLOB POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/macosx/*.c)
  1383     endif()
  1392     endif()
  1384     set(SOURCE_FILES ${SOURCE_FILES} ${POWER_SOURCES})
  1393     set(SOURCE_FILES ${SOURCE_FILES} ${POWER_SOURCES})
  1385     set(HAVE_SDL_POWER TRUE)
  1394     set(HAVE_SDL_POWER TRUE)
  1386     set(SDL_FRAMEWORK_CARBON 1)
       
  1387     set(SDL_FRAMEWORK_IOKIT 1)
  1395     set(SDL_FRAMEWORK_IOKIT 1)
  1388   endif()
  1396   endif()
  1389 
  1397 
  1390   if(SDL_TIMERS)
  1398   if(SDL_TIMERS)
  1391     set(SDL_TIMER_UNIX 1)
  1399     set(SDL_TIMER_UNIX 1)