Generate CMakeLists for convenient DevX in llvmDebugInfoC

^KT-63598
This commit is contained in:
Timofey Solonin
2023-11-29 09:43:52 +01:00
committed by Space Team
parent 0d67ae7b23
commit a03f0ef4ee
3 changed files with 36 additions and 3 deletions
+1
View File
@@ -0,0 +1 @@
CMakeLists.txt
+7
View File
@@ -0,0 +1,7 @@
# Working on C++ code
1. Generate CMakeLists.txt
```
./gradlew :kotlin-native:llvmDebugInfoC:generateCMakeLists
```
2. Open this directory in CLion
+28 -3
View File
@@ -23,9 +23,12 @@ plugins {
native {
val obj = if (HostManager.hostIsMingw) "obj" else "o"
val cxxStandard = 17
val llvmIncludeDir = "${llvmDir}/include"
val cxxflags = mutableListOf(
"--std=c++17",
"-I${llvmDir}/include",
"--std=c++${cxxStandard}",
"-I${llvmIncludeDir}",
"-I${projectDir}/src/main/include"
)
suffixes {
@@ -46,4 +49,26 @@ native {
tool(*hostPlatform.clangForJni.llvmAr("").toTypedArray())
flags("-qcv", ruleOut(), *ruleInAll())
}
}
// FIXME: Migrate to the compilation database approach when the clang calls are removed
tasks.register("generateCMakeLists") {
doLast {
projectDir.resolve("CMakeLists.txt").writeText(
"""
cmake_minimum_required(VERSION 3.26)
project(llvmDebugInfoC)
set(CMAKE_CXX_STANDARD ${cxxStandard})
include_directories(${llvmIncludeDir})
include_directories(src/main/include)
add_library(
llvmDebugInfoC
src/main/cpp/DebugInfoC.cpp
)
""".trimIndent()
)
}
}
}