Skip to content

Commit 3c83bb6

Browse files
committed
Added CMake build utils to Java library with native JNI project template.
Added CMake options for compiler source checks and compiler warnings. Signed-off-by: kilo52 <phil.gaiser@raven-computing.com>
1 parent 84c9513 commit 3c83bb6

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

java/03_library_native_jni/source/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ ${{VAR_CMAKE_LANG_SPEC}}
1515

1616
# Options
1717
option(${{VAR_PROJECT_NAME_UPPER}}_BUILD_TESTS "Enable/disable tests" ON)
18+
option(${{VAR_PROJECT_NAME_UPPER}}_SOURCE_ANALYSIS "Enable/disable source code static analysis by the compiler" OFF)
19+
option(
20+
${{VAR_PROJECT_NAME_UPPER}}_IGNORE_WARNINGS
21+
"Specifies whether compiler warnings should let the build \
22+
process fail (OFF) or whether they should be ignored (ON)"
23+
OFF
24+
)
1825

1926
# Set CMAKE_PREFIX_PATH from file
2027
if(EXISTS "${PROJECT_SOURCE_DIR}/.cmakeprefixpath")
@@ -25,5 +32,6 @@ endif()
2532

2633
include(Dependencies.cmake)
2734
include(cmake/TestUtil.cmake)
35+
include(cmake/BuildUtil.cmake)
2836

2937
add_subdirectory(src/main native)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
${{INCLUDE:c/cmake/BuildUtil.cmake}}

0 commit comments

Comments
 (0)