File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -52,11 +52,21 @@ if(APPLE)
5252 find_path (IOKit_INCLUDE_DIR NAMES IOKitLib.h HINTS ${IOKit_INC_SEARCH_PATH} ${IOKit_PKGC_INCLUDE_DIRS} PATH_SUFFIXES IOKit )
5353 list (APPEND JSSC_ADDITIONAL_INCLUDES ${IOKit_INCLUDE_DIR} )
5454 endif ()
55+ # Handle edge-case with legacy versioned SDK headers (e.g. usr/include/c++/4.2.1)
56+ if (CMAKE_OSX_SYSROOT)
57+ file (GLOB std_versions "${CMAKE_OSX_SYSROOT} /usr/include/c++/*" )
58+ foreach (std_version IN LISTS std_versions)
59+ if ("${std_version} " MATCHES "/v[0-9]*$" )
60+ # Ignore c++/v1 (should already be included)
61+ continue ()
62+ elseif (IS_DIRECTORY "${std_version} " )
63+ message (STATUS "Adding legacy include path: ${std_version} " )
64+ list (APPEND JSSC_ADDITIONAL_INCLUDES "${std_version} " )
65+ endif ()
66+ endforeach ()
67+ endif ()
5568endif ()
5669
57- set (CMAKE_CXX_STANDARD 11)
58- set (CMAKE_CXX_STANDARD_REQUIRED ON )
59-
6070# Statically link gcc/c++
6171if (MSVC )
6272 # /MT = Multithread, static version of the run-time library
You can’t perform that action at this time.
0 commit comments