You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
# Needs CMake 3.28 for module
cmake_minimum_required(VERSION 3.28)
project(ffmpegraph CXX)
set(CMAKE_CXX_STANDARD 26)
# color shit out
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
add_compile_options(-fdiagnostics-color=always)
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_compile_options(-fcolor-diagnostics)
endif()
# Use mold as the default linker, if it exists.
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
find_program(MOLD_LINKER "mold")
if (MOLD_LINKER)
add_link_options(-fuse-ld=mold)
endif()
endif()
# Find all the modules
file(GLOB_RECURSE modules src/*.cppm)
# Create the executable target
add_executable(ffmpegraph)
# Main file
target_sources(ffmpegraph PUBLIC
src/main.cpp
)
# The modules
target_sources(ffmpegraph PUBLIC
FILE_SET CXX_MODULES FILES
${modules}
)
#Compile flags
target_compile_options(ffmpegraph PRIVATE -Wall -Wextra # Standard screaming
-Wconversion -Wsign-conversion # Scream about accidentally converting stuff
-Werror=return-type # Scream extra hard at not returning when you should.
# Target detection black magic
$<$<CONFIG:DEBUG>:-O0 -g3 -glldb>
$<$<CONFIG:RELEASE>:-O3 -march=native>
)
# Link against exernal libraries
target_link_libraries(ffmpegraph PRIVATE raylib m)
|