Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
skiko
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liuqiang
skiko
Commits
f6f64305
Commit
f6f64305
authored
Dec 14, 2020
by
Nikolay Igotti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Build type work.
parent
64429099
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
17 deletions
+27
-17
build.gradle.kts
skiko/build.gradle.kts
+14
-16
properties.kt
skiko/buildSrc/src/main/kotlin/properties.kt
+13
-1
No files found.
skiko/build.gradle.kts
View file @
f6f64305
...
@@ -21,7 +21,7 @@ buildscript {
...
@@ -21,7 +21,7 @@ buildscript {
val
skiko
=
SkikoProperties
(
rootProject
)
val
skiko
=
SkikoProperties
(
rootProject
)
val
debug
=
false
val
debug
=
false
val
buildType
=
if
(
debug
)
"Debug"
else
"Release"
val
buildType
=
if
(
debug
)
SkiaBuildType
.
DEBUG
else
SkiaBuildType
.
RELEASE
allprojects
{
allprojects
{
group
=
"org.jetbrains.skiko"
group
=
"org.jetbrains.skiko"
...
@@ -231,33 +231,31 @@ tasks.withType(CppCompile::class.java).configureEach {
...
@@ -231,33 +231,31 @@ tasks.withType(CppCompile::class.java).configureEach {
"-DSK_SUPPORT_OPENCL=0"
,
"-DSK_SUPPORT_OPENCL=0"
,
"-Dskija_EXPORTS"
,
"-Dskija_EXPORTS"
,
"-DSK_UNICODE_AVAILABLE"
,
"-DSK_UNICODE_AVAILABLE"
,
"-DNDEBUG"
*
buildType
.
flags
))
))
when
(
targetOs
)
{
when
(
targetOs
)
{
OS
.
MacOS
->
{
OS
.
MacOS
->
{
compilerArgs
.
addAll
(
compilerArgs
.
addAll
(
listOf
(
listOf
(
"-std=c++14"
,
"-O3"
,
"-fvisibility=hidden"
,
"-fvisibility=hidden"
,
"-fvisibility-inlines-hidden"
,
"-fvisibility-inlines-hidden"
,
"-I$jdkHome/include/darwin"
,
"-I$jdkHome/include/darwin"
,
"-DSK_SHAPER_CORETEXT_AVAILABLE"
,
"-DSK_SHAPER_CORETEXT_AVAILABLE"
,
"-DSK_BUILD_FOR_MAC"
,
"-DSK_BUILD_FOR_MAC"
,
"-DSK_METAL"
"-DSK_METAL"
,
*
buildType
.
clangFlags
)
)
)
)
}
}
OS
.
Linux
->
{
OS
.
Linux
->
{
compilerArgs
.
addAll
(
compilerArgs
.
addAll
(
listOf
(
listOf
(
"-std=c++14"
,
"-O3"
,
"-fvisibility=hidden"
,
"-fvisibility=hidden"
,
"-fvisibility-inlines-hidden"
,
"-fvisibility-inlines-hidden"
,
"-I$jdkHome/include/linux"
,
"-I$jdkHome/include/linux"
,
"-DSK_BUILD_FOR_LINUX"
,
"-DSK_BUILD_FOR_LINUX"
,
"-DSK_R32_SHIFT=16"
"-DSK_R32_SHIFT=16"
,
*
buildType
.
clangFlags
)
)
)
)
}
}
...
@@ -272,9 +270,9 @@ tasks.withType(CppCompile::class.java).configureEach {
...
@@ -272,9 +270,9 @@ tasks.withType(CppCompile::class.java).configureEach {
"-DNOMINMAX"
,
"-DNOMINMAX"
,
"-DSK_GAMMA_APPLY_TO_A8"
,
"-DSK_GAMMA_APPLY_TO_A8"
,
"/utf-8"
,
"/utf-8"
,
"/
O2"
,
"/
GR-"
,
// no-RTTI.
"/GR-"
// no-RTTI.
*
buildType
.
msvcFlags
)
)
)
)
}
}
}
}
...
@@ -357,7 +355,7 @@ library {
...
@@ -357,7 +355,7 @@ library {
dependencies
{
dependencies
{
implementation
(
implementation
(
skiaDir
.
map
{
skiaDir
.
map
{
fileTree
(
it
.
resolve
(
"out/$
buildType
-${targetArch.id}"
))
fileTree
(
it
.
resolve
(
"out/$
{buildType.id}
-${targetArch.id}"
))
.
matching
{
include
(
if
(
targetOs
.
isWindows
)
"**.lib"
else
"**.a"
)
}
.
matching
{
include
(
if
(
targetOs
.
isWindows
)
"**.lib"
else
"**.a"
)
}
}
}
)
)
...
@@ -383,10 +381,10 @@ val skikoJvmJar: Provider<Jar> by tasks.registering(Jar::class) {
...
@@ -383,10 +381,10 @@ val skikoJvmJar: Provider<Jar> by tasks.registering(Jar::class) {
}
}
val
createChecksums
by
project
.
tasks
.
registering
(
org
.
gradle
.
crypto
.
checksum
.
Checksum
::
class
)
{
val
createChecksums
by
project
.
tasks
.
registering
(
org
.
gradle
.
crypto
.
checksum
.
Checksum
::
class
)
{
val
linkTask
=
project
.
tasks
.
named
(
"link$
buildType
${targetOs.id.capitalize()}"
)
val
linkTask
=
project
.
tasks
.
named
(
"link$
{buildType.id}
${targetOs.id.capitalize()}"
)
dependsOn
(
linkTask
)
dependsOn
(
linkTask
)
files
=
linkTask
.
get
().
outputs
.
files
.
filter
{
it
.
isFile
}
+
files
=
linkTask
.
get
().
outputs
.
files
.
filter
{
it
.
isFile
}
+
if
(
targetOs
.
isWindows
)
files
(
skiaDir
.
map
{
it
.
resolve
(
"out/$
buildType
-x64/icudtl.dat"
)
})
else
files
()
if
(
targetOs
.
isWindows
)
files
(
skiaDir
.
map
{
it
.
resolve
(
"out/$
{buildType.id}
-x64/icudtl.dat"
)
})
else
files
()
algorithm
=
Checksum
.
Algorithm
.
SHA256
algorithm
=
Checksum
.
Algorithm
.
SHA256
outputDir
=
file
(
"$buildDir/checksums"
)
outputDir
=
file
(
"$buildDir/checksums"
)
}
}
...
@@ -395,11 +393,11 @@ val skikoJvmRuntimeJar by project.tasks.registering(Jar::class) {
...
@@ -395,11 +393,11 @@ val skikoJvmRuntimeJar by project.tasks.registering(Jar::class) {
archiveBaseName
.
set
(
"skiko-$target"
)
archiveBaseName
.
set
(
"skiko-$target"
)
dependsOn
(
createChecksums
)
dependsOn
(
createChecksums
)
from
(
skikoJvmJar
.
map
{
zipTree
(
it
.
archiveFile
)
})
from
(
skikoJvmJar
.
map
{
zipTree
(
it
.
archiveFile
)
})
from
(
project
.
tasks
.
named
(
"link$
buildType
${targetOs.id.capitalize()}"
).
map
{
from
(
project
.
tasks
.
named
(
"link$
{buildType.id}
${targetOs.id.capitalize()}"
).
map
{
it
.
outputs
.
files
.
filter
{
it
.
isFile
}
it
.
outputs
.
files
.
filter
{
it
.
isFile
}
})
})
if
(
targetOs
.
isWindows
)
{
if
(
targetOs
.
isWindows
)
{
from
(
files
(
skiaDir
.
map
{
it
.
resolve
(
"out/$
buildType
-x64/icudtl.dat"
)
}))
from
(
files
(
skiaDir
.
map
{
it
.
resolve
(
"out/$
{buildType.id}
-x64/icudtl.dat"
)
}))
}
}
from
(
createChecksums
.
get
().
outputs
.
files
)
from
(
createChecksums
.
get
().
outputs
.
files
)
}
}
...
...
skiko/buildSrc/src/main/kotlin/properties.kt
View file @
f6f64305
...
@@ -13,7 +13,19 @@ enum class OS(val id: String) {
...
@@ -13,7 +13,19 @@ enum class OS(val id: String) {
enum
class
Arch
(
val
id
:
String
)
{
enum
class
Arch
(
val
id
:
String
)
{
X64
(
"x64"
),
X64
(
"x64"
),
Arm64
(
"arm64"
)
Arm64
(
"arm64"
),
}
enum
class
SkiaBuildType
(
val
id
:
String
,
val
flags
:
Array
<
String
>,
val
clangFlags
:
Array
<
String
>,
val
msvcFlags
:
Array
<
String
>
)
{
DEBUG
(
"Debug"
,
arrayOf
(
"-DSK_DEBUG"
),
arrayOf
(
"-std=c++14"
,
"-g"
),
emptyArray
()),
RELEASE
(
"Release"
,
arrayOf
(
"-DNDEBUG"
),
arrayOf
(
"-std=c++14"
,
"-O3"
),
arrayOf
(
"/O2"
))
;
override
fun
toString
()
=
id
}
}
val
hostOs
by
lazy
{
val
hostOs
by
lazy
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment