-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[build][Zig] Make more flags from src/config.h
configurable
#4407
base: master
Are you sure you want to change the base?
Conversation
Side note: I wonder if using |
Should be ready to merge; just needs reviews. Edit: #4411 could render a lot of the code here unnecessary, but I think it's worth merging this first and then removing it again later if the proposal is implemented. Perhaps I should add a code comment to indicate that the issue is worth subscribing to. Edit 2:
Actually, maybe this might break behaviour with |
@sagehane What is the state of this PR? Can it be merged? |
It's mostly okay but has a minor conflict because I extracted a portion of this patch to a different PR. I haven't had time to fix it and I don't know if I'll have much time for this until the end of the month. That said, this is an enhancement that could use testing and not a bug fix of some immediate issue so it could wait until you release a new version like you said you're planning to. Feel free to close it if you don't want noise in the PR tracker; I can just reopen it after you tag a new release. |
Okay, I finally had the time to update this PR. Here's the flags passed now: @as(*const [24:0]u8, "SUPPORT_MODULE_RSHAPES=1") @as(*const [26:0]u8, "SUPPORT_MODULE_RTEXTURES=1") @as(*const [22:0]u8, "SUPPORT_MODULE_RTEXT=1") @as(*const [24:0]u8, "SUPPORT_MODULE_RMODELS=1") @as(*const [23:0]u8, "SUPPORT_MODULE_RAUDIO=1") @as(*const [23:0]u8, "SUPPORT_CAMERA_SYSTEM=1") @as(*const [25:0]u8, "SUPPORT_GESTURES_SYSTEM=1") @as(*const [26:0]u8, "SUPPORT_RPRAND_GENERATOR=1") @as(*const [24:0]u8, "SUPPORT_MOUSE_GESTURES=1") @as(*const [26:0]u8, "SUPPORT_SSH_KEYBOARD_RPI=1") @as(*const [29:0]u8, "SUPPORT_WINMM_HIGHRES_TIMER=1") @as(*const [31:0]u8, "SUPPORT_PARTIALBUSY_WAIT_LOOP=1") @as(*const [24:0]u8, "SUPPORT_SCREEN_CAPTURE=1") @as(*const [23:0]u8, "SUPPORT_GIF_RECORDING=1") @as(*const [25:0]u8, "SUPPORT_COMPRESSION_API=1") @as(*const [27:0]u8, "SUPPORT_AUTOMATION_EVENTS=1") @as(*const [26:0]u8, "MAX_FILEPATH_CAPACITY=8192") @as(*const [24:0]u8, "MAX_FILEPATH_LENGTH=4096") @as(*const [21:0]u8, "MAX_KEYBOARD_KEYS=512") @as(*const [19:0]u8, "MAX_MOUSE_BUTTONS=8") @as(*const [14:0]u8, "MAX_GAMEPADS=4") @as(*const [18:0]u8, "MAX_GAMEPAD_AXIS=8") @as(*const [22:0]u8, "MAX_GAMEPAD_BUTTONS=32") @as(*const [31:0]u8, "MAX_GAMEPAD_VIBRATION_TIME=2.0f") @as(*const [18:0]u8, "MAX_TOUCH_POINTS=8") @as(*const [24:0]u8, "MAX_KEY_PRESSED_QUEUE=16") @as(*const [25:0]u8, "MAX_CHAR_PRESSED_QUEUE=16") @as(*const [25:0]u8, "MAX_DECOMPRESSION_SIZE=64") @as(*const [27:0]u8, "MAX_AUTOMATION_EVENTS=16384") @as(*const [30:0]u8, "RL_SUPPORT_MESH_GPU_SKINNING=1") @as(*const [26:0]u8, "RL_DEFAULT_BATCH_BUFFERS=1") @as(*const [30:0]u8, "RL_DEFAULT_BATCH_DRAWCALLS=256") @as(*const [36:0]u8, "RL_DEFAULT_BATCH_MAX_TEXTURE_UNITS=4") @as(*const [27:0]u8, "RL_MAX_MATRIX_STACK_SIZE=32") @as(*const [26:0]u8, "RL_MAX_SHADER_LOCATIONS=32") @as(*const [26:0]u8, "RL_CULL_DISTANCE_NEAR=0.01") @as(*const [27:0]u8, "RL_CULL_DISTANCE_FAR=1000.0") @as(*const [44:0]u8, "RL_DEFAULT_SHADER_ATTRIB_LOCATION_POSITION=0") @as(*const [44:0]u8, "RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD=1") @as(*const [42:0]u8, "RL_DEFAULT_SHADER_ATTRIB_LOCATION_NORMAL=2") @as(*const [41:0]u8, "RL_DEFAULT_SHADER_ATTRIB_LOCATION_COLOR=3") @as(*const [43:0]u8, "RL_DEFAULT_SHADER_ATTRIB_LOCATION_TANGENT=4") @as(*const [45:0]u8, "RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD2=5") @as(*const [43:0]u8, "RL_DEFAULT_SHADER_ATTRIB_LOCATION_INDICES=6") @as(*const [55:0]u8, "RL_DEFAULT_SHADER_ATTRIB_NAME_POSITION=\"vertexPosition\"") @as(*const [55:0]u8, "RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD=\"vertexTexCoord\"") @as(*const [51:0]u8, "RL_DEFAULT_SHADER_ATTRIB_NAME_NORMAL=\"vertexNormal\"") @as(*const [49:0]u8, "RL_DEFAULT_SHADER_ATTRIB_NAME_COLOR=\"vertexColor\"") @as(*const [53:0]u8, "RL_DEFAULT_SHADER_ATTRIB_NAME_TANGENT=\"vertexTangent\"") @as(*const [57:0]u8, "RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD2=\"vertexTexCoord2\"") @as(*const [40:0]u8, "RL_DEFAULT_SHADER_UNIFORM_NAME_MVP=\"mvp\"") @as(*const [45:0]u8, "RL_DEFAULT_SHADER_UNIFORM_NAME_VIEW=\"matView\"") @as(*const [57:0]u8, "RL_DEFAULT_SHADER_UNIFORM_NAME_PROJECTION=\"matProjection\"") @as(*const [47:0]u8, "RL_DEFAULT_SHADER_UNIFORM_NAME_MODEL=\"matModel\"") @as(*const [49:0]u8, "RL_DEFAULT_SHADER_UNIFORM_NAME_NORMAL=\"matNormal\"") @as(*const [49:0]u8, "RL_DEFAULT_SHADER_UNIFORM_NAME_COLOR=\"colDiffuse\"") @as(*const [52:0]u8, "RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE0=\"texture0\"") @as(*const [52:0]u8, "RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE1=\"texture1\"") @as(*const [52:0]u8, "RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE2=\"texture2\"") @as(*const [25:0]u8, "SUPPORT_QUADS_DRAW_MODE=1") @as(*const [27:0]u8, "SPLINE_SEGMENT_DIVISIONS=24") @as(*const [24:0]u8, "SUPPORT_FILEFORMAT_PNG=1") @as(*const [24:0]u8, "SUPPORT_FILEFORMAT_GIF=1") @as(*const [24:0]u8, "SUPPORT_FILEFORMAT_QOI=1") @as(*const [24:0]u8, "SUPPORT_FILEFORMAT_DDS=1") @as(*const [22:0]u8, "SUPPORT_IMAGE_EXPORT=1") @as(*const [26:0]u8, "SUPPORT_IMAGE_GENERATION=1") @as(*const [28:0]u8, "SUPPORT_IMAGE_MANIPULATION=1") @as(*const [22:0]u8, "SUPPORT_DEFAULT_FONT=1") @as(*const [24:0]u8, "SUPPORT_FILEFORMAT_TTF=1") @as(*const [24:0]u8, "SUPPORT_FILEFORMAT_FNT=1") @as(*const [27:0]u8, "SUPPORT_TEXT_MANIPULATION=1") @as(*const [30:0]u8, "SUPPORT_FONT_ATLAS_WHITE_REC=1") @as(*const [27:0]u8, "MAX_TEXT_BUFFER_LENGTH=1024") @as(*const [23:0]u8, "MAX_TEXTSPLIT_COUNT=128") @as(*const [24:0]u8, "SUPPORT_FILEFORMAT_OBJ=1") @as(*const [24:0]u8, "SUPPORT_FILEFORMAT_MTL=1") @as(*const [24:0]u8, "SUPPORT_FILEFORMAT_IQM=1") @as(*const [25:0]u8, "SUPPORT_FILEFORMAT_GLTF=1") @as(*const [24:0]u8, "SUPPORT_FILEFORMAT_VOX=1") @as(*const [24:0]u8, "SUPPORT_FILEFORMAT_M3D=1") @as(*const [25:0]u8, "SUPPORT_MESH_GENERATION=1") @as(*const [20:0]u8, "MAX_MATERIAL_MAPS=12") @as(*const [24:0]u8, "SUPPORT_FILEFORMAT_WAV=1") @as(*const [24:0]u8, "SUPPORT_FILEFORMAT_OGG=1") @as(*const [24:0]u8, "SUPPORT_FILEFORMAT_MP3=1") @as(*const [24:0]u8, "SUPPORT_FILEFORMAT_QOA=1") @as(*const [23:0]u8, "SUPPORT_FILEFORMAT_XM=1") @as(*const [24:0]u8, "SUPPORT_FILEFORMAT_MOD=1") @as(*const [33:0]u8, "AUDIO_DEVICE_FORMAT=ma_format_f32") @as(*const [23:0]u8, "AUDIO_DEVICE_CHANNELS=2") @as(*const [26:0]u8, "AUDIO_DEVICE_SAMPLE_RATE=0") @as(*const [33:0]u8, "MAX_AUDIO_BUFFER_POOL_CHANNELS=16") @as(*const [25:0]u8, "SUPPORT_STANDARD_FILEIO=1") @as(*const [18:0]u8, "SUPPORT_TRACELOG=1") @as(*const [27:0]u8, "MAX_TRACELOG_MSG_LENGTH=256") @as(*const [25:0]u8, "SUPPORT_CLIPBOARD_IMAGE=1") It's worth noting that these newly introduced lines are hard to parse properly due to them being defined inside a conditional block. Lines 279 to 301 in 00396e3
The project currently successfully compiles when passing I think it can still be treated as a draft until a new release comes out. |
src/config.h
configurablesrc/config.h
configurable
This PR does not depend on #4406.
Currently, only flags containing the word
SUPPORT
is override-able via-Dconfig
. This was the case as there was no code to check for what value they were set to, and allSUPPORT
flags have a value of 1. This is also not ideal because it'll cause unexpected behaviour if the convention of the currentsrc/config.h
changes.With this PR, everything that isn't defined between
#ifdef
or#ifndef
and#endif
can be passed or configured. I didn't bother evaluating flags between those as they already seem to be meant to be configured and truly evaluating them would be very annoying.List of flags that are now passed by default when passing
-Dconfig
: