mirror of
https://github.com/YACReader/yacreader
synced 2026-04-12 15:49:53 -04:00
Scope compiler defines and remove forced 7zip NDEBUG
This commit is contained in:
@ -1,13 +1,31 @@
|
||||
# Compiler options for YACReader
|
||||
# Compiler policy for YACReader-owned targets.
|
||||
# Keep this target internal so third-party code does not inherit our rules.
|
||||
add_library(yacreader_build_options INTERFACE)
|
||||
|
||||
target_compile_definitions(yacreader_build_options INTERFACE
|
||||
QT_DISABLE_DEPRECATED_UP_TO=0x060400
|
||||
)
|
||||
|
||||
if(MSVC)
|
||||
# Prevent windows.h from defining min/max macros that conflict with
|
||||
# std::min, std::max, std::numeric_limits<T>::max(), etc.
|
||||
add_compile_definitions(NOMINMAX)
|
||||
target_compile_definitions(yacreader_build_options INTERFACE
|
||||
# Prevent windows.h from defining min/max macros that conflict with
|
||||
# std::min, std::max, std::numeric_limits<T>::max(), etc.
|
||||
NOMINMAX
|
||||
)
|
||||
|
||||
# /Zc:__cplusplus: report correct __cplusplus value
|
||||
# /permissive-: strict standard conformance
|
||||
add_compile_options(/Zc:__cplusplus /permissive-)
|
||||
target_compile_options(yacreader_build_options INTERFACE
|
||||
# /Zc:__cplusplus: report correct __cplusplus value
|
||||
# /permissive-: strict standard conformance
|
||||
$<$<COMPILE_LANG_AND_ID:CXX,MSVC>:/Zc:__cplusplus>
|
||||
$<$<COMPILE_LANG_AND_ID:CXX,MSVC>:/permissive->
|
||||
)
|
||||
endif()
|
||||
|
||||
add_compile_definitions(QT_DISABLE_DEPRECATED_UP_TO=0x060400)
|
||||
function(yacreader_apply_build_options)
|
||||
foreach(target_name IN LISTS ARGN)
|
||||
if(NOT TARGET "${target_name}")
|
||||
message(FATAL_ERROR "yacreader_apply_build_options(): unknown target '${target_name}'")
|
||||
endif()
|
||||
target_link_libraries("${target_name}" PRIVATE yacreader_build_options)
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
Reference in New Issue
Block a user