Skip to content

Add support for .mc files in CygwinCCompiler+MinGW32Compiler / Add support for windmc compiling routine#405

Open
Avasam wants to merge 1 commit into
pypa:mainfrom
Avasam:Add-support-for-windmc-compiling-routine
Open

Add support for .mc files in CygwinCCompiler+MinGW32Compiler / Add support for windmc compiling routine#405
Avasam wants to merge 1 commit into
pypa:mainfrom
Avasam:Add-support-for-windmc-compiling-routine

Conversation

@Avasam

@Avasam Avasam commented Mar 28, 2026

Copy link
Copy Markdown
Contributor

Port of pypa/setuptools#4742 from @raedrizqie with added type hints and deduplicated try-catch

I noticed this compiler was missing support whilst trying to add first-party MinGW support to pywin32.

Tested at:

Comment on lines +70 to +83
self.cc, self.cxx, self.rc, self.mc = get_config_vars(
'CC', 'CXX', 'WINDRES', 'WINDMC'
)

# Override 'CC' and 'CXX' environment variables for
# Override environment variables for
# building using MINGW compiler for MSVC python.
self.cc = os.environ.get('CC', self.cc or 'gcc')
self.cxx = os.environ.get('CXX', self.cxx or 'g++')
self.rc = os.environ.get( # resource compiler
"WINDRES", cast('str', self.rc) or "windres"
)
self.mc = os.environ.get( # message compiler
"WINDMC", cast('str', self.mc) or "windmc"
)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if I'm overcomplicating and should just do:

Suggested change
self.cc, self.cxx, self.rc, self.mc = get_config_vars(
'CC', 'CXX', 'WINDRES', 'WINDMC'
)
# Override 'CC' and 'CXX' environment variables for
# Override environment variables for
# building using MINGW compiler for MSVC python.
self.cc = os.environ.get('CC', self.cc or 'gcc')
self.cxx = os.environ.get('CXX', self.cxx or 'g++')
self.rc = os.environ.get( # resource compiler
"WINDRES", cast('str', self.rc) or "windres"
)
self.mc = os.environ.get( # message compiler
"WINDMC", cast('str', self.mc) or "windmc"
)
self.cc, self.cxx = get_config_vars('CC', 'CXX')
# Override 'CC' and 'CXX' environment variables for
# building using MINGW compiler for MSVC python.
self.cc = os.environ.get('CC', self.cc or 'gcc')
self.cxx = os.environ.get('CXX', self.cxx or 'g++')
self.rc = os.environ.get("WINDRES", "windres") # resource compiler
self.mc = os.environ.get("WINDMC", "windmc") # message compiler

@Avasam Avasam force-pushed the Add-support-for-windmc-compiling-routine branch 3 times, most recently from 42600cc to 1dfbcd7 Compare July 5, 2026 02:51
Co-Authored-By: Raed Rizqie <raed.rizqie@gmail.com>
@Avasam Avasam force-pushed the Add-support-for-windmc-compiling-routine branch from 1dfbcd7 to 242f403 Compare July 5, 2026 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant