In the new kotlinx.datetime
library the documentation states:
Implementation
The implementation of date/time types, such as
Instant
,LocalDateTime
,TimeZone
and so on, relies on:
- in JVM:
java.time
API;- in JS:
js-joda
library;- in Native: based on ThreeTen backport project
- time zone support is provided by date C++ library;
Indeed in the cinterop Gradle configuration code i noticed those lines:
targets.withType<org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget> {
compilations["main"].cinterops {
create("date") {
val cinteropDir = "$projectDir/nativeMain/cinterop"
val dateLibDir = "${project(":").projectDir}/thirdparty/date"
headers("$cinteropDir/public/cdate.h")
defFile("nativeMain/cinterop/date.def")
// common options
extraOpts("-Xsource-compiler-option", "-std=c++17")
extraOpts("-Xsource-compiler-option", "-I$cinteropDir/public")
extraOpts("-Xsource-compiler-option", "-include$cinteropDir/cpp/defines.hpp")
// *nix support
extraOpts("-Xcompile-source", "$dateLibDir/src/tz.cpp")
extraOpts("-Xcompile-source", "$dateLibDir/src/ios.mm")
extraOpts("-Xsource-compiler-option", "-I$dateLibDir/include")
extraOpts("-Xcompile-source", "$cinteropDir/cpp/cdate.cpp")
// iOS support
extraOpts("-Xcompile-source", "$cinteropDir/cpp/apple.mm")
// Windows support
extraOpts("-Xcompile-source", "$cinteropDir/cpp/windows.cpp")
}
}
There are many .cpp
file references and a manual cinterop compiler option to use C++17
Is there any documentation or roadmap for C++ cinterop-ing?