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 intopypa: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 intopypa:mainfrom
Avasam:Add-support-for-windmc-compiling-routine

Conversation

@Avasam
Copy link
Copy Markdown
Contributor

@Avasam Avasam commented Mar 28, 2026

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:

Co-Authored-By: Raed Rizqie <raed.rizqie@gmail.com>
@Avasam Avasam force-pushed the Add-support-for-windmc-compiling-routine branch from 1808e12 to 3d2bd90 Compare May 3, 2026 01:49
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

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