From 6e9bb7e480960373247d5ec9eeb86f9566b31afa Mon Sep 17 00:00:00 2001 From: Macoy Madson Date: Sat, 29 Jan 2022 10:11:45 -0800 Subject: [PATCH] Add missing defines to CUSTOMIZE_BUILD block (#2318) This fixes compilation and linking errors when CUSTOMIZE_BUILD is ON. Any option wasn't actually applied if it wasn't in this list. I also added a message which makes it a bit easier to confirm you have successfully enabled an option. --- cmake/CompileDefinitions.cmake | 35 +++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/cmake/CompileDefinitions.cmake b/cmake/CompileDefinitions.cmake index 36062b30..7fbbef99 100644 --- a/cmake/CompileDefinitions.cmake +++ b/cmake/CompileDefinitions.cmake @@ -4,26 +4,35 @@ target_compile_definitions("raylib" PUBLIC "${GRAPHICS}") function(define_if target variable) if (${${variable}}) + message(STATUS "${variable}=${${variable}}") target_compile_definitions(${target} PUBLIC "${variable}") endif () endfunction() if (${CUSTOMIZE_BUILD}) target_compile_definitions("raylib" PUBLIC EXTERNAL_CONFIG_FLAGS) + define_if("raylib" USE_AUDIO) + define_if("raylib" SUPPORT_MODULE_RSHAPES) + define_if("raylib" SUPPORT_MODULE_RTEXTURES) + define_if("raylib" SUPPORT_MODULE_RTEXT) + define_if("raylib" SUPPORT_MODULE_RMODELS) + define_if("raylib" SUPPORT_MODULE_RAUDIO) define_if("raylib" SUPPORT_CAMERA_SYSTEM) define_if("raylib" SUPPORT_GESTURES_SYSTEM) define_if("raylib" SUPPORT_MOUSE_GESTURES) define_if("raylib" SUPPORT_SSH_KEYBOARD_RPI) - define_if("raylib" SUPPORT_BUSY_WAIT_LOOP) - define_if("raylib" SUPPORT_EVENTS_WAITING) + define_if("raylib" SUPPORT_DEFAULT_FONT) define_if("raylib" SUPPORT_SCREEN_CAPTURE) define_if("raylib" SUPPORT_GIF_RECORDING) - define_if("raylib" SUPPORT_HIGH_DPI) - define_if("raylib" SUPPORT_COMPRESSION_API) + define_if("raylib" SUPPORT_BUSY_WAIT_LOOP) + define_if("raylib" SUPPORT_EVENTS_WAITING) + define_if("raylib" SUPPORT_WINMM_HIGHRES_TIMER) define_if("raylib" SUPPORT_DATA_STORAGE) - define_if("raylib" SUPPORT_VR_SIMULATOR) - define_if("raylib" SUPPORT_FONT_TEXTURE) + define_if("raylib" SUPPORT_COMPRESSION_API) define_if("raylib" SUPPORT_QUADS_DRAW_MODE) + define_if("raylib" SUPPORT_IMAGE_EXPORT) + define_if("raylib" SUPPORT_IMAGE_GENERATION) + define_if("raylib" SUPPORT_IMAGE_MANIPULATION) define_if("raylib" SUPPORT_FILEFORMAT_PNG) define_if("raylib" SUPPORT_FILEFORMAT_DDS) define_if("raylib" SUPPORT_FILEFORMAT_HDR) @@ -33,32 +42,28 @@ if (${CUSTOMIZE_BUILD}) define_if("raylib" SUPPORT_FILEFORMAT_TGA) define_if("raylib" SUPPORT_FILEFORMAT_JPG) define_if("raylib" SUPPORT_FILEFORMAT_GIF) + define_if("raylib" SUPPORT_FILEFORMAT_QOI) define_if("raylib" SUPPORT_FILEFORMAT_PSD) define_if("raylib" SUPPORT_FILEFORMAT_PKM) define_if("raylib" SUPPORT_FILEFORMAT_PVR) - define_if("raylib" ORT_IMAGE_EXPORT) - define_if("raylib" SUPPORT_IMAGE_MANIPULATION) - define_if("raylib" SUPPORT_IMAGE_GENERATION) - define_if("raylib" SUPPORT_DEFAULT_FONT) define_if("raylib" SUPPORT_FILEFORMAT_FNT) define_if("raylib" SUPPORT_FILEFORMAT_TTF) define_if("raylib" SUPPORT_TEXT_MANIPULATION) + define_if("raylib" SUPPORT_MESH_GENERATION) define_if("raylib" SUPPORT_FILEFORMAT_OBJ) define_if("raylib" SUPPORT_FILEFORMAT_MTL) define_if("raylib" SUPPORT_FILEFORMAT_IQM) define_if("raylib" SUPPORT_FILEFORMAT_GLTF) - define_if("raylib" SUPPORT_MESH_GENERATION) + define_if("raylib" SUPPORT_FILEFORMAT_VOX) define_if("raylib" SUPPORT_FILEFORMAT_WAV) define_if("raylib" SUPPORT_FILEFORMAT_OGG) define_if("raylib" SUPPORT_FILEFORMAT_XM) define_if("raylib" SUPPORT_FILEFORMAT_MOD) - define_if("raylib" SUPPORT_FILEFORMAT_FLAC) define_if("raylib" SUPPORT_FILEFORMAT_MP3) + define_if("raylib" SUPPORT_FILEFORMAT_FLAC) define_if("raylib" SUPPORT_STANDARD_FILEIO) define_if("raylib" SUPPORT_TRACELOG) - define_if("raylib" SUPPORT_COMPRESSION_API) - - + if (UNIX AND NOT APPLE) target_compile_definitions("raylib" PUBLIC "MAX_FILEPATH_LENGTH=4096") else ()