summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeDetermineJavaCompiler.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/CMakeDetermineJavaCompiler.cmake')
-rw-r--r--Modules/CMakeDetermineJavaCompiler.cmake3
1 files changed, 3 insertions, 0 deletions
diff --git a/Modules/CMakeDetermineJavaCompiler.cmake b/Modules/CMakeDetermineJavaCompiler.cmake
index 03e7719..3b787a9 100644
--- a/Modules/CMakeDetermineJavaCompiler.cmake
+++ b/Modules/CMakeDetermineJavaCompiler.cmake
@@ -6,6 +6,9 @@ IF(NOT CMAKE_Java_COMPILER)
# prefer the environment variable CC
IF($ENV{JAVA_COMPILER} MATCHES ".+")
GET_FILENAME_COMPONENT(CMAKE_Java_COMPILER_INIT $ENV{JAVA_COMPILER} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT)
+ IF(CMAKE_Java_FLAGS_ENV_INIT)
+ SET(CMAKE_Java_COMPILER_ARG1 ${CMAKE_Java_FLAGS_ENV_INIT} CACHE STRING "First argument to Java compiler")
+ ENDIF(CMAKE_Java_FLAGS_ENV_INIT)
IF(EXISTS ${CMAKE_Java_COMPILER_INIT})
ELSE(EXISTS ${CMAKE_Java_COMPILER_INIT})
MESSAGE(SEND_ERROR "Could not find compiler set in environment variable JAVA_COMPILER:\n$ENV{JAVA_COMPILER}.")