mirror of
https://github.com/microsoft/GSL.git
synced 2025-02-17 23:33:49 -05:00
Suppress Warnings in GSL Headers (#731)
Suppress warnings in GSL headers using the SYSTEM keyword for target_include_directories(). This enables developers to see warnings standalone builds but hides them from users in non-standalone builds.
This commit is contained in:
parent
88aca1caf3
commit
0f68d133fa
@ -51,11 +51,21 @@ target_compile_definitions(GSL INTERFACE
|
|||||||
)
|
)
|
||||||
|
|
||||||
# add include folders to the library and targets that consume it
|
# add include folders to the library and targets that consume it
|
||||||
target_include_directories(GSL INTERFACE
|
# the SYSTEM keyword suppresses warnings for users of the library
|
||||||
$<BUILD_INTERFACE:
|
if(GSL_STANDALONE_PROJECT)
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/include
|
target_include_directories(GSL INTERFACE
|
||||||
>
|
$<BUILD_INTERFACE:
|
||||||
)
|
${CMAKE_CURRENT_SOURCE_DIR}/include
|
||||||
|
>
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
target_include_directories(GSL SYSTEM INTERFACE
|
||||||
|
$<BUILD_INTERFACE:
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/include
|
||||||
|
>
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
if ((CMAKE_VERSION GREATER 3.7.9) OR (CMAKE_VERSION EQUAL 3.7.9))
|
if ((CMAKE_VERSION GREATER 3.7.9) OR (CMAKE_VERSION EQUAL 3.7.9))
|
||||||
if (MSVC_IDE)
|
if (MSVC_IDE)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user