cgbwebcam/CMakeLists.txt

53 lines
1.1 KiB
CMake

cmake_minimum_required(VERSION 3.9)
project(cgbwebcam)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# i think SDL should be setting this
if(APPLE)
set(CMAKE_EXE_LINKER_FLAGS "-framework AVFoundation")
endif()
set(SDL_STATIC ON)
set(SDL_SHARED OFF)
set(SDL_AUDIO OFF)
set(SDL_CAMERA ON)
set(SDL_VIDEO ON)
add_subdirectory(SDL)
set(BUILD_GL OFF)
set(BUILD_GLES2 OFF)
set(BUILD_GLES3 OFF)
set(BUILD_LIBRETRO OFF)
set(BUILD_PYTHON OFF)
set(BUILD_QT OFF)
set(BUILD_SDL OFF)
set(BUILD_SHARED OFF)
set(BUILD_STATIC ON)
set(DISABLE_DEPS ON)
set(ENABLE_SCRIPTING OFF)
set(LIBMGBA_ONLY ON)
set(M_CORE_GB ON)
set(M_CORE_GBA OFF)
set(USE_DEBUGGERS OFF)
set(USE_DISCORD_RPC OFF)
set(USE_FFMPEG OFF)
set(USE_LUA OFF)
add_subdirectory(mgba)
include_directories(SDL/include)
include_directories(mgba/include)
#set_source_files_properties(main.c PROPERTIES COMPILE_FLAGS "-Wall -Werror -pedantic -std=c89")
add_executable(cgbwebcam main.c)
target_link_libraries(cgbwebcam SDL3-static mgba)
include(CheckIPOSupported)
check_ipo_supported(RESULT lto)
if(lto)
set_property(TARGET cgbwebcam PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
endif()