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

The libisomediafile target should not specify build-specific compiler options #59

Open
inkychris opened this issue May 29, 2024 · 0 comments

Comments

@inkychris
Copy link

The hard-coding of compiler options conflict with options that might be required in parent projects. These should be moved to the configuration stage for testing in this project and/or guarded with an option to allow the parent projects to prevent them from being set if needed.

if (MSVC)
# warning level 4 and all warnings as errors
add_compile_options(/W4 /WX)
else()
# lots of warnings and all warnings as errors
add_compile_options(-Wall -Wextra -pedantic -Werror)
endif()

target_compile_options(
${PROJECT_NAME}
PRIVATE
# GNU compiler
$<$<C_COMPILER_ID:GNU>:-Wall -W -ansi -pedantic -Wno-long-long -Wmissing-prototypes>
# Visual Studio run time library
$<$<AND:$<C_COMPILER_ID:MSVC>,$<CONFIG:Debug>>:/MTd>
$<$<AND:$<C_COMPILER_ID:MSVC>,$<NOT:$<CONFIG:Debug>>>:/MT>
)

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

No branches or pull requests

1 participant