Skip to content

Commit b914d02

Browse files
committed
Fix cmake warnings related to unused variables
Newer versions of cmake (e.g. 3.22.1) warn: Manually-specified variables were not used by the project: OPENJDK_VERSION_NUMBER_FOUR_POSITIONS OPENSSL_CFLAGS * only specify OPENJDK_VERSION_NUMBER_FOUR_POSITIONS on Windows * remove unused definition of OPENSSL_CFLAGS Adjust OpenSSL build to avoid overwriting OPENSSL_CFLAGS. Signed-off-by: Keith W. Campbell <[email protected]>
1 parent 81bcbb8 commit b914d02

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

closed/OpenJ9.gmk

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -255,11 +255,12 @@ CMAKE_ARGS := \
255255
-DOMR_MIXED_REFERENCES_MODE=$(OMR_MIXED_REFERENCES_MODE) \
256256
-DOPENJ9_BUILD=true \
257257
-DOPENJ9_SHA=$(OPENJ9_SHA) \
258-
-DOPENJDK_VERSION_NUMBER_FOUR_POSITIONS=$(VERSION_NUMBER_FOUR_POSITIONS) \
259258
#
260259

261-
# Windows can't specify compiler overrides since we already generated wrapper scripts.
262-
ifneq (windows,$(OPENJDK_TARGET_OS))
260+
ifeq ($(call isTargetOs, windows), true)
261+
CMAKE_ARGS += -DOPENJDK_VERSION_NUMBER_FOUR_POSITIONS=$(VERSION_NUMBER_FOUR_POSITIONS)
262+
else
263+
# Windows can't specify compiler overrides since we use wrapper scripts.
263264
# Override the compilers if an OPENJ9_* value is specified.
264265
# Otherwise, toolchain.cmake has the default values.
265266
ifneq (,$(OPENJ9_CC))
@@ -294,10 +295,6 @@ endif # OPENJ9_ENABLE_JFR
294295
ifeq (true,$(OPENJ9_ENABLE_JITSERVER))
295296
CMAKE_ARGS += -DJ9VM_OPT_JITSERVER=ON
296297

297-
ifneq (,$(OPENSSL_CFLAGS))
298-
CMAKE_ARGS += -DOPENSSL_CFLAGS="$(OPENSSL_CFLAGS)"
299-
endif
300-
301298
ifneq (,$(OPENSSL_DIR))
302299
CMAKE_ARGS += -DOPENSSL_DIR="$(OPENSSL_DIR)"
303300
endif

closed/openssl.gmk

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,10 @@ ifeq (,$(OPENSSL_TARGET))
9292
$(error Unsupported platform $(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU))
9393
endif # OPENSSL_TARGET
9494

95-
OPENSSL_CFLAGS :=
9695
ifeq ($(OPENJDK_TARGET_CPU), s390x)
97-
OPENSSL_CFLAGS := -march=z10
96+
OPENSSL_CONFIG_CFLAGS := -march=z10
97+
else
98+
OPENSSL_CONFIG_CFLAGS :=
9899
endif
99100

100101
ifneq (,$(CCACHE))
@@ -106,8 +107,8 @@ ifneq (,$(CCACHE))
106107
endif # CCACHE
107108

108109
build_openssl :
109-
@$(ECHO) Compiling OpenSSL in $(OPENSSL_DIR) for $(OPENSSL_TARGET) with additional CFLAGS $(OPENSSL_CFLAGS)
110-
( $(OPENSSL_CONFIG_SETUP) $(CD) $(OPENSSL_DIR) && $(PERL) Configure $(OPENSSL_CFLAGS) $(OPENSSL_TARGET) shared )
110+
@$(ECHO) Compiling OpenSSL in $(OPENSSL_DIR) for $(OPENSSL_TARGET)$(if $(OPENSSL_CONFIG_CFLAGS), with additional CFLAGS $(OPENSSL_CONFIG_CFLAGS))
111+
( $(OPENSSL_CONFIG_SETUP) $(CD) $(OPENSSL_DIR) && $(PERL) Configure $(OPENSSL_CONFIG_CFLAGS) $(OPENSSL_TARGET) shared )
111112
$(OPENSSL_PATCH)
112113
( $(OPENSSL_MAKE_SETUP) $(CD) $(OPENSSL_DIR) && $(OPENSSL_MAKE) )
113114

0 commit comments

Comments
 (0)