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