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

Fix Windows CMake build error #175

Closed
wants to merge 2 commits into from
Closed

Fix Windows CMake build error #175

wants to merge 2 commits into from

Conversation

messense
Copy link
Member

@messense messense commented Sep 10, 2023

Closes #174


Generated summary (powered by Graphite)

TL;DR

This pull request modifies the CI.yml and zig.rs files to improve error handling and to set the CMake variables as cache variables.

What changed

In the CI.yml file, the set -e command was replaced with set -euo pipefail to ensure that the script stops on the first error it encounters and does not ignore any errors. This change was made in multiple places in the file.

In the zig.rs file, the CMake variables CMAKE_C_COMPILER, CMAKE_CXX_COMPILER, CMAKE_LINKER, and CMAKE_RANLIB are now set as cache variables. This is done by appending CACHE FILEPATH "" to the set command. This change ensures that the variables are stored in the CMake cache and can be reused in subsequent CMake runs.

How to test

To test these changes, you can run the CI workflow. If the workflow completes successfully, it means that the changes are working as expected. You can also manually run the commands in the CI.yml file and check if they stop execution upon encountering an error.

To test the changes in the zig.rs file, you can run a CMake build and check if the CMake variables are correctly set as cache variables. You can do this by inspecting the CMakeCache.txt file or by using the cmake -LH command.

Why make this change

The changes in the CI.yml file improve error handling by ensuring that the script stops execution when it encounters an error. This can help in identifying and fixing issues more quickly.

The changes in the zig.rs file make the CMake build process more efficient by storing the CMake variables in the cache. This can speed up subsequent CMake runs as the variables do not need to be recalculated.

@messense messense marked this pull request as ready for review September 10, 2023 11:36
@messense messense force-pushed the windows-cmake branch 2 times, most recently from d92a7e9 to 7b7c5b6 Compare September 10, 2023 12:58
@messense messense changed the title Fix Windows CMake Invalid character escape '\U' error Fix Windows CMake build error Sep 10, 2023
@messense messense closed this Aug 16, 2024
@messense messense deleted the windows-cmake branch August 16, 2024 08:56
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.

CMake build error on Windows
1 participant