Skip to content

Disable CMake build type checks on Windows #386

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

Merged
merged 1 commit into from
Mar 27, 2024

Conversation

PatKamin
Copy link
Contributor

Description

Do not rely on the CMAKE_BUILD_TYPE configuration variable in Windows builds. This variable is ignored by MSVC, the build type is determined during the build time based on the --config parameter.

There seems to be no way for disabling the proxy library build based on the used config, so this change provides just notification messages on all Windows builds and builds proxy library always.

Fixes: #362

Checklist

  • Code compiles without errors locally
  • All tests pass locally
  • CI workflows execute properly
  • CI workflows, not executed per PR (e.g. Nightly), execute properly
  • New tests added, especially if they will fail without my changes
  • Added/extended example(s) to cover this functionality
  • Extended the README/documentation
  • All newly added source files have a license
  • All newly added source files are referenced in CMake files
  • Logger (with debug/info/... messages) is used

@PatKamin PatKamin requested a review from a team as a code owner March 25, 2024 13:39
Copy link
Contributor

@lukaszstolarczuk lukaszstolarczuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm.. TBH I expected some changes with the syntax you described in the issue (e.g. if ($<CONFIG:Release>)) - I guess they weren't needed after all...?

@PatKamin PatKamin force-pushed the fix-build-type-on-windows branch 2 times, most recently from 7365499 to 20fb2af Compare March 25, 2024 15:14
Do not rely on the CMAKE_BUILD_TYPE configuration variable in Windows
builds. This variable is ignored by MSVC, the build type is determined
during the build time based on the '--config' parameter.

There seems to be no way for disabling the proxy library build based on
the used config, so this change provides just notification messages on
all Windows builds and builds proxy library always.
@PatKamin PatKamin force-pushed the fix-build-type-on-windows branch from 20fb2af to dd56f12 Compare March 26, 2024 14:37
@PatKamin
Copy link
Contributor Author

hmm.. TBH I expected some changes with the syntax you described in the issue (e.g. if ($<CONFIG:Release>)) - I guess they weren't needed after all...?

I've tried quite a few approaches of using such generators ie. to disable the proxy library creation based on config. However, generator expressions can be used only in some cases, in some of CMake functions (which I didn't find helpful in this case). Originally I thought there are no such limitations.

However, we still cannot rely on CMAKE_BUILD_TYPE on Windows in the CI and this has to be changed somehow.

@bratpiorka bratpiorka merged commit 47ce308 into oneapi-src:main Mar 27, 2024
@PatKamin PatKamin deleted the fix-build-type-on-windows branch December 31, 2024 13:05
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_TYPE is used for some CMake checks on Windows
3 participants