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

Update configure.py to support set CXX to LLVM clang-cl for MSVC platform. #2557

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zufuliu
Copy link
Contributor

@zufuliu zufuliu commented Jan 21, 2025

This PR also disabled generating configure task for Windows when any configuration variable is set, to fix CreateProcess failure:

H:\llvm\ninja-fork>ninja.bootstrap.exe configure
[1/1] CXX=clang-cl python3.exe ./configure.py
FAILED: [code=1] build.ninja
CXX=clang-cl python3.exe ./configure.py
CreateProcess failed: The system cannot find the file specified.
ninja: error: rebuilding 'build.ninja': subcommand failed
-if not host.is_mingw():
+if not host.is_windows() or not configure_env:

ninja/configure.py

Lines 748 to 757 in 6b5d7a7

if not host.is_mingw():
n.comment('Regenerate build files if build script changes.')
n.rule('configure',
command='${configure_env}%s $root/configure.py $configure_args' %
options.with_python,
generator=True)
n.build('build.ninja', 'configure',
implicit=['$root/configure.py',
os.path.normpath('$root/misc/ninja_syntax.py')])
n.newline()

@jhasse
Copy link
Collaborator

jhasse commented Jan 21, 2025

Not sure if we should reimplement CMake in configure.py ...

@zufuliu
Copy link
Contributor Author

zufuliu commented Jan 22, 2025

Currently configure.py set more options than CMakeLists.txt, though some of them (mostly /wd or -Wno) may be irrelevant now. run configure.py --bootstrap is lightweight than run cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release ../ninja.

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.

2 participants