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

Support windows platform #1024

Open
chen3feng opened this issue Sep 21, 2023 · 0 comments
Open

Support windows platform #1024

chen3feng opened this issue Sep 21, 2023 · 0 comments

Comments

@chen3feng
Copy link
Owner

chen3feng commented Sep 21, 2023

Notes:

Print includes with -showIncludes

cl -nologo -c -showIncludes world.c
world.c
Note: including file: C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt\stdio.h
Note: including file:  C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt\corecrt.h
Note: including file:   C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.34.31933\include\vcruntime.h
Note: including file:    C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.34.31933\include\sal.h
Note: including file:     C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.34.31933\include\concurrencysal.h
Note: including file:    C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.34.31933\include\vadefs.h
Note: including file:  C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt\corecrt_wstdio.h
Note: including file:   C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt\corecrt_stdio_config.h

https://ninja-build.org/manual.html#_deps

Whole archive link

https://learn.microsoft.com/en-us/cpp/build/reference/wholearchive-include-all-library-object-files?view=msvc-170
PS: MacOS: -all_load and -noall_load

Windows SDK Dir

HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Microsoft SDKs\Windows\v10.0

Check whether Windows console support color

def windows_console_support_ansi_color():
    from ctypes import byref, windll, c_uint32
    ENABLE_VIRTUAL_TERMINAL_PROCESSING = 0x0004
    STD_OUTPUT_HANDLE = -11
    STD_ERROR_HANDLE = -12
    INVALID_HANDLE_VALUE = -1
    handle = windll.kernel32.GetStdHandle(STD_ERROR_HANDLE)
    if handle == INVALID_HANDLE_VALUE:
        return False
    mode = c_uint32()
    if not windll.kernel32.GetConsoleMode(handle, byref(mode)):
        return False
    return (mode.value & ENABLE_VIRTUAL_TERMINAL_PROCESSING) != 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant