haskell / haskell/cabal

Implementation Plan for Windows Resource Files (#142)

Open
#6,939 8 comments 0 reactions 0 assignees View on GitHub
data-files platform: windows type: enhancement
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

RC scripts are quite common for Win32 application development. It'd be nice if Cabal were able to compile and link resource scripts at build time. Since `windres.exe` comes with mingw-w64, all that's needed is to teach cabal how to use it generate object files from RC files. I'd like to propose the following:

- Addition of an `rc-sources` field to the cabal file spec, functioning just like `c-sources`, `asm-sources`, etc.
- Addition of an `rc-options` (or perhaps `windres-options`) field to the cabal file spec, functioning just like `cc-options`, etc.
- Have cabal call `windres.exe` on all of the `rc-sources` with the `rc-options`, respecting the `includes` and `include-dirs` fields, and the `--extra-include-dirs` flag.
- Have cabal include the resulting object files when linking, just like object files generated from `c-sources`.

If this is a reasonable path forward, I'd be happy to tackle the implementation.

Contributor guide

Open the contributing guide

Research direction

Start by reading Cabal's existing handling of c-sources and asm-sources, including how fields, options, include paths, and generated object files are processed. Define the resource-file fields and windres.exe integration there; done means RC sources compile with the requested options and include paths and their objects participate in linking.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.