Generate CMakeLists for convenient DevX in llvmDebugInfoC
^KT-63598
This commit is contained in:
committed by
Space Team
parent
0d67ae7b23
commit
a03f0ef4ee
@@ -0,0 +1 @@
|
||||
CMakeLists.txt
|
||||
@@ -0,0 +1,7 @@
|
||||
# Working on C++ code
|
||||
|
||||
1. Generate CMakeLists.txt
|
||||
```
|
||||
./gradlew :kotlin-native:llvmDebugInfoC:generateCMakeLists
|
||||
```
|
||||
2. Open this directory in CLion
|
||||
@@ -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()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user