planetis-m / naylib

Yet another raylib Nim wrapper
MIT License
233 stars 10 forks source link

Added configuration support, fixes #133 #154

Closed planetis-m closed 1 week ago

planetis-m commented 1 week ago

AI generated.

Prompt used **Task:** Given a `config.h` file, perform the following actions: 1. **Extract Defines:** Identify all `SUPPORT_` defines, including those that are commented out, along with their associated doc comments. 2. **Generate Config File:** Create a `rconfig.nim` file that conditionally enables the extracted C defines using Nim's defines. 3. **Naming Convention:** Ensure the Nim defines use idiomatic naming and are prefixed with `Naylib`. 4. **Default Values:** Set the default value of the Nim defines based on whether the corresponding C preprocessor define is enabled or not. **Example Output Format:** ```nim # comments from original file const NaylibSupportFileFormatPNG {.booldefine.} = true # default value depends on whether the C preprocessor define is enabled or not when NaylibSupportFileFormatPNG: {.passC: "-DSUPPORT_FILEFORMAT_PNG=1".} ``` **Additional Notes:** - Preserve the doc comments from the original `config.h` file. - Ensure the Nim defines are correctly formatted and follow Nim's syntax conventions.