VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'src/Makefile')
-rw-r--r--src/Makefile18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/Makefile b/src/Makefile
index 65d9a4ef..5e3c903c 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -294,7 +294,10 @@ ifeq "$(shell uname -s)" "Darwin"
#check to see if XCode 3 path exists.Otherwise, use XCode 4 path
VC_OSX_SDK_PATH := /Developer/SDKs/MacOSX$(VC_OSX_SDK).sdk
ifeq ($(wildcard $(VC_OSX_SDK_PATH)/SDKSettings.plist),)
- VC_OSX_SDK_PATH := /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$(VC_OSX_SDK).sdk
+ VC_OSX_SDK_PATH := $(shell xcrun --sdk macosx$(VC_OSX_SDK) --show-sdk-path)
+ ifeq ($(VC_OSX_SDK_PATH),)
+$(error Specified SDK version was not found, ensure your active developer directory is correct through xcode-select)
+ endif
endif
#----- Legacy build if OSX <= 10.8: we build both 32-bit and 64-bit ----
@@ -310,17 +313,12 @@ ifeq "$(shell uname -s)" "Darwin"
CXXFLAGS += -std=c++11
C_CXX_FLAGS += -DTC_UNIX -DTC_BSD -DTC_MACOSX -mmacosx-version-min=$(VC_OSX_TARGET) -isysroot $(VC_OSX_SDK_PATH)
LFLAGS += -mmacosx-version-min=$(VC_OSX_TARGET) -Wl,-syslibroot $(VC_OSX_SDK_PATH)
- #Xcode 15 linker emits a warning "no platform load command found" when linking object files generated by yasm
+ # Xcode 15 linker emits a warning "no platform load command found" when linking object files generated by yasm
# To suppress this warning, we need to use -Wl,-ld_classic flag in order to use the old ld64 linker
# https://mjtsai.com/blog/2024/03/15/xcode-15-no-platform-load-command-found/
- # Check Xcode version for using specific linker flag
- XCODE_VERSION := $(shell xcodebuild -version 2>/dev/null | grep 'Xcode' | sed -E 's/Xcode ([0-9]+).*/\1/')
- ifneq ($(XCODE_VERSION),)
- ifeq "$(shell expr $(XCODE_VERSION) \>= 15)" "1"
- LFLAGS += -Wl,-ld_classic
- endif
- else
- $(error Xcode not found, please check your installation)
+ # We can check whether newer linker is in use if ld -v reports dyld instead of ld64.
+ ifeq ($(shell xcrun --sdk macosx$(VC_OSX_SDK) ld -v 2>&1 | grep -oE 'PROJECT:[^-]+' | cut -d: -f2),dyld)
+ LFLAGS += -Wl,-ld_classic
endif
WX_CONFIGURE_FLAGS += --with-macosx-version-min=$(VC_OSX_TARGET) --with-macosx-sdk=$(VC_OSX_SDK_PATH)