check for std::optional as macos can be broke af sometimes

pull/1269/head
Jeff Becker 4 years ago
parent 5a24d2deef
commit abc1f67430
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -52,10 +52,15 @@ if(WITH_HIVE)
set(WITH_SHARED ON)
endif()
include(CheckCXXSourceCompiles)
include(CheckLibraryExists)
include(cmake/target_link_libraries_system.cmake)
include(cmake/add_import_library.cmake)
include(cmake/add_log_tag.cmake)
include(cmake/libatomic.cmake)
include(cmake/check_for_std_optional.cmake)
include(cmake/check_for_std_filesystem.cmake)
if (STATIC_LINK AND STATIC_LINK_RUNTIME)
message(FATAL "Cannot set both STATIC_LINK and STATIC_LINK_RUNTIME")

@ -0,0 +1,18 @@
# check for std::optional because macos is broke af sometimes
set(std_optional_code [[
#include <optional>
int main() {
std::optional<int> maybe;
maybe = 1;
return maybe.value() == 1;
}
]])
check_cxx_source_compiles("${std_optional_code}" was_compiled)
if(was_compiled)
message(STATUS "we have std::optional")
else()
message(FATAL_ERROR "we dont have std::optional your compiler is broke af")
endif()

@ -2,9 +2,6 @@ if(NOT UNIX)
return()
endif()
include(CheckCXXSourceCompiles)
include(CheckLibraryExists)
# can't have UNIX defined
# can't have the include paths for libuv either?
if(NOT IOS AND NOT ANDROID AND NOT WIN32)
@ -76,8 +73,6 @@ endif()
set(EXE_LIBS ${STATIC_LIB})
include(check_for_std_filesystem)
if(RELEASE_MOTTO)
add_definitions(-DLLARP_RELEASE_MOTTO="${RELEASE_MOTTO}")
endif()

Loading…
Cancel
Save