-
-
Notifications
You must be signed in to change notification settings - Fork 264
Description
Summary
The Windows build of Firebird 3.0.13, 4.0.6, and 5.0.3 cannot reliably detect
the correct target platform on modern Visual Studio environments due to
incorrect logic in setenvvar.bat. This prevents proper Win32/Win64
separation and causes the build system to behave incorrectly.
This issue was observed while using Microsoft Visual Studio 2022 Build Tools.
Problem Details
setenvvar.bat determines the target platform using the
PROCESSOR_ARCHITECTURE environment variable.
However, with VS2022 Build Tools, PROCESSOR_ARCHITECTURE always reports
AMD64 even when using the x86 Native Tools Command Prompt.
As a result:
FB_TARGET_PLATFORMis always set tox64FB_OUTPUT_DIRalways points tooutput_x64clean_allremoves the wrong output directory- Win32 builds do not behave correctly because the environment is misconfigured
This behavior was verified on:
- Firebird 3.0.13
- Firebird 4.0.6
- Firebird 5.0.3
Expected Behavior
When using the x86 Native Tools Command Prompt,
FB_TARGET_PLATFORM should be set to Win32, and the build system should
produce valid Win32 output directories and behave consistently.
Proposed Fix
Use the %Platform% environment variable provided by Visual Studio instead of
PROCESSOR_ARCHITECTURE.
%Platform% correctly reports x86 or x64 depending on the toolchain
invoked, and works consistently with VS2022 Build Tools.
I will submit a pull request with this fix.