JRE-483 JBSDK does not compile with Xcode 9
Fixed Xcode 8 build failure with newer (unsupported) options
diff --git a/make/bsd/makefiles/gcc.make b/make/bsd/makefiles/gcc.make
index 3d201d2..95761ce 100644
--- a/make/bsd/makefiles/gcc.make
+++ b/make/bsd/makefiles/gcc.make
@@ -87,6 +87,7 @@
ifeq ($(DSYMUTIL),)
DSYMUTIL=dsymutil
endif
+ XCODE_VER := $(shell xcodebuild -version | head -n1 | sed 's/Xcode //' | cut -d'.' -f1)
endif
ifeq ($(USE_CLANG), true)
@@ -257,7 +258,7 @@
# Not yet supported by clang in Xcode 4.6.2
# WARNINGS_ARE_ERRORS += -Wno-tautological-constant-out-of-range-compare
WARNINGS_ARE_ERRORS += -Wno-delete-non-virtual-dtor -Wno-deprecated -Wno-format -Wno-dynamic-class-memaccess
- WARNINGS_ARE_ERRORS += -Wno-empty-body -Wno-shorten-64-to-32 -Wno-sign-conversion
+ WARNINGS_ARE_ERRORS += -Wno-empty-body
endif
WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef
@@ -267,7 +268,15 @@
# conversions which might affect the values. Only enable it in earlier versions.
WARNING_FLAGS = -Wunused-function
ifeq ($(USE_CLANG),)
- WARNING_FLAGS += -Wno-conversion -Wno-logical-op-parentheses -Wno-tautological-undefined-compare -Wno-shift-negative-value -Wno-switch -Wno-format
+ ifeq ($(OS_VENDOR), Darwin)
+ ifeq "$(shell expr $(XCODE_VER) \>= 9 )" "1"
+ WARNING_FLAGS += -Wno-conversion -Wno-logical-op-parentheses -Wno-tautological-undefined-compare -Wno-shift-negative-value -Wno-switch -Wno-format -Wno-shorten-64-to-32 -Wno-sign-conversion
+ else
+ WARNING_FLAGS += -Wconversion
+ endif
+ else
+ WARNING_FLAGS += -Wconversion
+ endif
endif
endif