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

cmake: Add a function to setup all build targets with the same strictness #98

Merged
merged 1 commit into from
Sep 7, 2023

Conversation

christophe-lunarg
Copy link
Contributor

Question: Here I am using add_compile_options does it affect other target that would add this repository to it's project?
Using find_package and add_subdirctory?

I am using add_compile_options because this is was used for /WX.

@juan-lunarg
Copy link
Contributor

Question: Here I am using add_compile_options does it affect other target that would add this repository to it's project?
Using find_package and add_subdirctory?

add_compile_options won't affect projects found via find_package. That's one of the reasons I actually prefer find_package.

add_compile_options WILL affect the project absorbed using add_subdirectory. This is often annoying when dealing with third party libraries.

CMakeLists.txt Outdated Show resolved Hide resolved
@christophe-lunarg christophe-lunarg changed the title cmake: Use W4 warnings on MSVC to match GCC/Clang warning level cmake: Add a function to setup all build targets with the same strictness Sep 7, 2023
@christophe-lunarg christophe-lunarg force-pushed the cmake-w4-msvc branch 2 times, most recently from df24160 to fbcb967 Compare September 7, 2023 13:06
@@ -101,6 +101,47 @@ if (UPDATE_DEPS)
include("${UPDATE_DEPS_DIR}/helper.cmake")
endif()
endif()

# Configure compiler build options common to all targets
function(lunarg_target_compiler_configurations TARGET_NAME WERROR_OPTION)
Copy link
Contributor

Choose a reason for hiding this comment

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

What would be ideal is if we could actually share this code elegantly with the other repos that consume the utility libraries.

I think this can be done. I'll wait until this gets merged though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes that's what I was thinking!

@christophe-lunarg christophe-lunarg merged commit a3235b3 into main Sep 7, 2023
20 checks passed
@christophe-lunarg christophe-lunarg deleted the cmake-w4-msvc branch September 7, 2023 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants