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
ba25a5c5
Unverified
Commit
ba25a5c5
authored
Nov 08, 2021
by
Nikolay Igotti
Committed by
GitHub
Nov 08, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only create objcCompile task on macOS, fails on Windows in IDE (#360)
parent
fe6bf4af
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
27 deletions
+29
-27
build.gradle.kts
skiko/build.gradle.kts
+29
-27
No files found.
skiko/build.gradle.kts
View file @
ba25a5c5
...
@@ -711,33 +711,35 @@ val linkJvmBindings = tasks.register<LinkSkikoTask>("linkJvmBindings") {
...
@@ -711,33 +711,35 @@ val linkJvmBindings = tasks.register<LinkSkikoTask>("linkJvmBindings") {
flags
.
set
(
listOf
(*
osFlags
))
flags
.
set
(
listOf
(*
osFlags
))
}
}
// Very hacky way to compile Objective-C sources and add the
if
(
hostOs
==
OS
.
MacOS
)
{
// resulting object files into the final library.
// Very hacky way to compile Objective-C sources and add the
project
.
tasks
.
register
<
Exec
>(
"objcCompile"
)
{
// resulting object files into the final library.
val
inputDir
=
"$projectDir/src/jvmMain/objectiveC/${targetOs.id}"
project
.
tasks
.
register
<
Exec
>(
"objcCompile"
)
{
val
outDir
=
"$buildDir/objc/$target"
val
inputDir
=
"$projectDir/src/jvmMain/objectiveC/${targetOs.id}"
val
names
=
File
(
inputDir
).
listFiles
()
!!
.
map
{
it
.
name
.
removeSuffix
(
".mm"
)
}
val
outDir
=
"$buildDir/objc/$target"
val
srcs
=
names
.
map
{
"$inputDir/$it.mm"
}.
toTypedArray
()
val
names
=
File
(
inputDir
).
listFiles
()
!!
.
map
{
it
.
name
.
removeSuffix
(
".mm"
)
}
val
outs
=
names
.
map
{
"$outDir/$it.o"
}.
toTypedArray
()
val
srcs
=
names
.
map
{
"$inputDir/$it.mm"
}.
toTypedArray
()
workingDir
=
File
(
outDir
)
val
outs
=
names
.
map
{
"$outDir/$it.o"
}.
toTypedArray
()
val
skiaDir
=
skiaJvmBindingsDir
.
get
().
absolutePath
workingDir
=
File
(
outDir
)
commandLine
=
listOf
(
val
skiaDir
=
skiaJvmBindingsDir
.
get
().
absolutePath
"clang"
,
commandLine
=
listOf
(
*
targetOs
.
clangFlags
,
"clang"
,
"-I$jdkHome/include"
,
*
targetOs
.
clangFlags
,
"-I$jdkHome/include/darwin"
,
"-I$jdkHome/include"
,
"-I$skiaDir"
,
"-I$jdkHome/include/darwin"
,
"-I$skiaDir/include"
,
"-I$skiaDir"
,
"-I$skiaDir/include/gpu"
,
"-I$skiaDir/include"
,
"-fobjc-arc"
,
"-I$skiaDir/include/gpu"
,
"-DSK_METAL"
,
"-fobjc-arc"
,
"-std=c++17"
,
"-DSK_METAL"
,
"-c"
,
"-std=c++17"
,
*
srcs
"-c"
,
)
*
srcs
file
(
outDir
).
mkdirs
()
)
inputs
.
files
(
srcs
)
file
(
outDir
).
mkdirs
()
outputs
.
files
(
outs
)
inputs
.
files
(
srcs
)
outputs
.
files
(
outs
)
}
}
}
val
generateVersion
=
project
.
tasks
.
register
(
"generateVersion"
)
{
val
generateVersion
=
project
.
tasks
.
register
(
"generateVersion"
)
{
...
...
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