diff --git a/rcljava/CMakeLists.txt b/rcljava/CMakeLists.txt index 85cba623..1dc0de29 100644 --- a/rcljava/CMakeLists.txt +++ b/rcljava/CMakeLists.txt @@ -38,7 +38,9 @@ if(NOT WIN32) add_compile_options(-Wall -Wextra -Wpedantic) endif() -set(CMAKE_JAVA_COMPILE_FLAGS "-source" "1.6" "-target" "1.6") +if (NOT CMAKE_JAVA_COMPILE_FLAGS) + set(CMAKE_JAVA_COMPILE_FLAGS "-source" "1.6" "-Xlint:-options") +endif() include_directories(include) diff --git a/rcljava_common/CMakeLists.txt b/rcljava_common/CMakeLists.txt index 228f24ea..7fe685a5 100644 --- a/rcljava_common/CMakeLists.txt +++ b/rcljava_common/CMakeLists.txt @@ -31,7 +31,9 @@ if(NOT WIN32) add_compile_options(-Wall -Wextra -Wpedantic) endif() -set(CMAKE_JAVA_COMPILE_FLAGS "-source" "1.6" "-target" "1.6") +if (NOT CMAKE_JAVA_COMPILE_FLAGS) + set(CMAKE_JAVA_COMPILE_FLAGS "-source" "1.6" "-Xlint:-options") +endif() set(${PROJECT_NAME}_java_sources "src/main/java/org/ros2/rcljava/common/JNIUtils.java"