@@ -93,7 +93,7 @@ elseif (${proc_description} MATCHES "Intel")
9393elseif ( ${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "x86_64" )
9494 # This is a fallback for when the above doesn't work. It should work
9595 # for most x86_64 processors, but it is not guaranteed to be optimal.
96- message (WARNING "Unknown processory type. Defaulting to a generic x86_64 processor. Performance may be suboptimal." )
96+ message (WARNING "Unknown processor type. Defaulting to a generic x86_64 processor. Performance may be suboptimal." )
9797 set (COREAVX2_FLAG "" )
9898 # Once you are in here, you are probably on Rosetta, but not required.
9999 # Still, on Apple Rosetta we also now need to use the ld_classic as the linker
@@ -102,9 +102,12 @@ elseif ( ${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "x86_64" )
102102 execute_process (COMMAND "pkgutil"
103103 "--pkg-info=com.apple.pkg.CLTools_Executables"
104104 OUTPUT_VARIABLE TEST )
105- string (REGEX REPLACE ".*version: ([0-9]+).*" "\\ 1" CMDLINE_UTILS_VERSION ${TEST} )
106- message (STATUS "Apple command line utils major version is '${CMDLINE_UTILS_VERSION} '" )
107- if (${CMDLINE_UTILS_VERSION} VERSION_GREATER 14)
105+
106+ # Extract the full version X.Y
107+ string (REGEX REPLACE ".*version: ([0-9]+\\ .[0-9]+).*" "\\ 1" CMDLINE_UTILS_VERSION ${TEST} )
108+ message (STATUS "Apple command line utils version is '${CMDLINE_UTILS_VERSION} '" )
109+
110+ if ((${CMDLINE_UTILS_VERSION} VERSION_GREATER 14) AND (${CMDLINE_UTILS_VERSION} VERSION_LESS 16.3))
108111 message (STATUS "Adding link options '-Wl,-ld_classic'" )
109112 add_link_options (-Wl,-ld_classic )
110113 endif ()
0 commit comments