Skip to content

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

@inkychris

Description

@inkychris

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>
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions