Cmake备忘录

JNI

1
2
3
include_directories(
/PATH/TO/JDK/include
)

其他头文件同理
例:

1
2
3
4
5
6
7
8
cmake_minimum_required(VERSION 3.14)
project(JNI)

set(CMAKE_CXX_STANDARD 14)
include_directories(
/usr/local/graalvm/19.1.1/include
)
add_library(JNI SHARED library.cpp JNI.h)

linker flags

1
set (CMAKE_SHARED_LINKER_FLAGS "-lpthread")