From 2031042e92b1e4f36c5b3a5d32328b356522c248 Mon Sep 17 00:00:00 2001 From: Ivan Santiago Paunovic Date: Wed, 12 May 2021 17:49:46 -0300 Subject: [PATCH 1/2] Remove target 1.6, ignore warnings about deprecated options Signed-off-by: Ivan Santiago Paunovic --- rcljava/CMakeLists.txt | 2 +- rcljava_common/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rcljava/CMakeLists.txt b/rcljava/CMakeLists.txt index 85cba623..ffe73c2a 100644 --- a/rcljava/CMakeLists.txt +++ b/rcljava/CMakeLists.txt @@ -38,7 +38,7 @@ if(NOT WIN32) add_compile_options(-Wall -Wextra -Wpedantic) endif() -set(CMAKE_JAVA_COMPILE_FLAGS "-source" "1.6" "-target" "1.6") +set(CMAKE_JAVA_COMPILE_FLAGS "-source" "6" "-Xlint:-options") include_directories(include) diff --git a/rcljava_common/CMakeLists.txt b/rcljava_common/CMakeLists.txt index 228f24ea..7cacbbec 100644 --- a/rcljava_common/CMakeLists.txt +++ b/rcljava_common/CMakeLists.txt @@ -31,7 +31,7 @@ if(NOT WIN32) add_compile_options(-Wall -Wextra -Wpedantic) endif() -set(CMAKE_JAVA_COMPILE_FLAGS "-source" "1.6" "-target" "1.6") +set(CMAKE_JAVA_COMPILE_FLAGS "-source" "1.6" "-Xlint:-options") set(${PROJECT_NAME}_java_sources "src/main/java/org/ros2/rcljava/common/JNIUtils.java" From 145ae9fc1f192cc872fb32aa609fa0ebfabc4377 Mon Sep 17 00:00:00 2001 From: Ivan Santiago Paunovic Date: Wed, 12 May 2021 17:51:29 -0300 Subject: [PATCH 2/2] Only add flags if they weren't specified internally Signed-off-by: Ivan Santiago Paunovic --- rcljava/CMakeLists.txt | 4 +++- rcljava_common/CMakeLists.txt | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/rcljava/CMakeLists.txt b/rcljava/CMakeLists.txt index ffe73c2a..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" "6" "-Xlint:-options") +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 7cacbbec..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" "-Xlint:-options") +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"