Skip to content

Commit e5d84cf

Browse files
James BarbettiJames Barbetti
James Barbetti
authored and
James Barbetti
committed
Minor tweaks for clang 12 compiles.
Clang 15.0.2 still isn't linking, though. I get complaints, "ld: library not found for -lc++"
1 parent 73a2ca7 commit e5d84cf

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

CMakeLists.txt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,15 +136,21 @@ if (WIN32)
136136
SET(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
137137
elseif (APPLE)
138138
message("Target OS : Mac OS X")
139+
message("Target System Name : ${CMAKE_HOST_SYSTEM_NAME}")
140+
message("Target System Version : ${CMAKE_HOST_SYSTEM_VERSION}")
139141
# to be compatible back to Mac OS X 10.7
140142
if (DECENTTREE_FLAGS MATCHES "oldmac")
141143
add_definitions("-mmacosx-version-min=10.5")
142144
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -mmacosx-version-min=10.5")
143145
elseif (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
144146
#Don't set --target parameter for Gnu C++ on MacOS
145-
else()
147+
elseif (CMAKE_HOST_SYSTEM_VERSION VERSION_LESS 20)
148+
#Don't do this for MacOS BigSur or later
146149
add_definitions("--target=x86_64-apple-macos10.7")
147150
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --target=x86_64-apple-macos10.7")
151+
else()
152+
add_definitions("--target=x86_64-apple-macos10.7")
153+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --target=x86_64-apple-macos10.8")
148154
endif()
149155
SET(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
150156
elseif (UNIX)
@@ -249,6 +255,7 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
249255
endif()
250256

251257
# use libc++ per default in MacOS
258+
# set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -v")
252259
if (APPLE)
253260
SET(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
254261
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
@@ -689,7 +696,8 @@ if (WIN32)
689696
set(PLATFORM_LIB "ws2_32")
690697
endif()
691698
else()
692-
set(PLATFORM_LIB "m")
699+
#This doesn't look to be needed for clang-15 builds
700+
#set(PLATFORM_LIB "m")
693701
endif()
694702

695703
if (DECENTTREE_FLAGS MATCHES "libcxx")

zlib-1.2.7/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ project(zlib C)
55

66
if (APPLE)
77
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
8-
if ("${CMAKE_CXX_COMPILER_VERSION}" VERSION_GREATER "12")
8+
if ("${CMAKE_CXX_COMPILER_VERSION}" VERSION_GREATER_EQUAL 13)
99
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-deprecated-non-prototype")
1010
endif()
1111
endif()

0 commit comments

Comments
 (0)