1
0
Fork 0
cmake_helpers/external/ranges/CMakeLists.txt
John Preston eb97b772a3 Revert "Fix build on MSVC 16.6.0."
This reverts commit e4f4dad321.

MSVC 16.6.* has a critical bug if Qt is compiled with it. See:

https://developercommunity.visualstudio.com/content/problem/1072443/
static-structs-with-atomics-initialization-regress.html
2020-06-16 18:26:49 +04:00

26 lines
No EOL
1 KiB
CMake

# This file is part of Desktop App Toolkit,
# a set of libraries for developing nice desktop applications.
#
# For license and copyright information please follow this link:
# https://github.com/desktop-app/legal/blob/master/LEGAL
add_library(external_ranges INTERFACE IMPORTED GLOBAL)
add_library(desktop-app::external_ranges ALIAS external_ranges)
if (DESKTOP_APP_USE_PACKAGED AND NOT DESKTOP_APP_USE_PACKAGED_LAZY)
find_package(range-v3 REQUIRED)
target_link_libraries(external_ranges INTERFACE range-v3::range-v3)
else()
target_include_directories(external_ranges SYSTEM
INTERFACE
${third_party_loc}/range-v3/include
)
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
target_compile_options(external_ranges
INTERFACE
/experimental:preprocessor # need for range-v3 see https://github.com/ericniebler/range-v3#supported-compilers
/wd5105 # needed for `/experimental:preprocessor`, suppressing C5105 "macro expansion producing 'defined' has undefined behavior"
)
endif()
endif()