Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build: Detect DETOURS_TARGET_PROCESSOR from VS Developer Command Prompt #128

Merged
merged 1 commit into from
Aug 30, 2020

Conversation

bgianfo
Copy link
Contributor

@bgianfo bgianfo commented Aug 28, 2020

The VS Developer command prompts sets two variables based on the configuration
which was launched. One is the architecture of the host compiler, the other is
the architecture that the compiler is targeting.

C:\> set | rg VSCMD_ARG_
VSCMD_ARG_HOST_ARCH=x64
VSCMD_ARG_TGT_ARCH=x86

$(VSCMD_ARG_TGT_ARCH) is a direct mapping to what the user is expected to set
the $(DETOURS_TARGET_PROCESSOR) environment variable too. For cross compilation
and normal compilation the variable is always set to the value that is expected.

This change uses this to our advantage so that users won't have to manually set
the $(DETOURS_TARGET_PROCESSOR) variable in order to compile.

The VS Developer command prompts sets two variables based on the configuration
which was launched. One is the architecture of the host compiler, the other is
the architecture that the compiler is targeting.

    ```
    C:\> set | rg VSCMD_ARG_
    VSCMD_ARG_HOST_ARCH=x64
    VSCMD_ARG_TGT_ARCH=x86
```

$(VSCMD_ARG_TGT_ARCH) is a direct mapping to what the user is expected to set
the $(DETOURS_TARGET_PROCESSOR) environment variable too. For cross compilation
and normal compilation the variable is always set to the value that is expected.

This change uses this to our advantage so that users won't have to manually set
the $(DETOURS_TARGET_PROCESSOR) variable in order to compile.
@bgianfo bgianfo requested a review from dtarditi August 28, 2020 05:41
@bgianfo bgianfo added the enhancement This adds new functionallity to the product label Aug 28, 2020
@bgianfo bgianfo merged commit d059c02 into microsoft:master Aug 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This adds new functionallity to the product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants