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

Set global compile flags for UR targets only #701

Merged
merged 1 commit into from
Jul 13, 2023

Conversation

PatKamin
Copy link
Contributor

Currently, some of compile flags are set globally for the whole project and third-party libraries. Wrap all Unified Runtime CMake targets so that compile and linking flags can be added globally but without affecting third-party repositories' builds.

cmake/helpers.cmake Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
@PatKamin
Copy link
Contributor Author

This list is going to be a pain to maintain.

Alternatively, why not wrap add_executable/add_library to set the UR specific options? This is a pattern used by LLVM and a number of other projects.

I agree, added wrapper functions which adds UR-specific compile flags to targets.

@PatKamin
Copy link
Contributor Author

I'd argue that we do want third party libraries compiled with sanitizer flags, sanitizers work best when all code has the instrumentation compiled in.

Leaving sanitizer flags to be set globally.

@PatKamin PatKamin requested a review from wlemkows July 12, 2023 13:23
@PatKamin PatKamin marked this pull request as ready for review July 13, 2023 07:17
Currently, some of compile flags are set globally for the whole project
including third-party libraries.
Introduce wrapper functions for add_executable and add_library
CMake functions in order to add compile flags only where needed.
@pbalcer pbalcer merged commit d808cab into oneapi-src:main Jul 13, 2023
20 checks passed
@PatKamin PatKamin deleted the wrap-ur-targets branch June 26, 2024 10:08
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.

3 participants