Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed build on Windows. Refactored Gradle scripts. #621

Closed
wants to merge 11 commits into from
Prev Previous commit
Next Next commit
Reverted target switching. Enabled DCE.
  • Loading branch information
VDovidaytis-HORIS committed Oct 31, 2022
commit 3bad1f8f732a5fbbd05f85d1da72dd86806d86ca
31 changes: 11 additions & 20 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -198,27 +198,18 @@ subprojects {

kotlin{
if (project.buildSettings.build_python_extension) {
if (version.contains("alpha")){
if (currentOs.macOsX & currentOsArch.amd64) {
macosX64()
} else if (currentOs.macOsX & currentOsArch.arm) {
macosArm64()
} else if (currentOs.linux & currentOsArch.amd64) {
linuxX64()
} else if (currentOs.linux & currentOsArch.arm) {
linuxArm64()
}
} else {
if (currentOs.macOsX) {
macosArm64()
macosX64()
} else if (currentOs.linux) {
linuxArm64()
linuxX64()
}
}
if (currentOs.windows) {
if (currentOs.macOsX & currentOsArch.amd64) {
macosX64()
} else if (currentOs.macOsX & currentOsArch.arm) {
macosArm64()
} else if (currentOs.linux & currentOsArch.amd64) {
linuxX64()
} else if (currentOs.linux & currentOsArch.arm) {
linuxArm64()
} else if (currentOs.windows) {
mingwX64()
} else {
throw new Exception("Unsupported platform.")
}
}
}
Expand Down
3 changes: 0 additions & 3 deletions js-package/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ kotlin {
target {
browser {
dceTask {
// DCE disabled to prevent 'Exception in thread "main" java.lang.StackOverflowError' error.
dceOptions.devMode = true

keep.addAll(
"lets-plot-js-package.buildPlotFromRawSpecs",
"lets-plot-js-package.buildPlotFromProcessedSpecs",
Expand Down
51 changes: 21 additions & 30 deletions python-extension/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,41 +15,32 @@ def currentOsArch = DefaultNativePlatform.getCurrentArchitecture()

kotlin {
if (project.buildSettings.build_python_extension) {
def targetList = []
if (version.contains("alpha")){
if (currentOs.macOsX & currentOsArch.amd64) {
targetList.add(macosX64("native"))
} else if (currentOs.macOsX & currentOsArch.arm) {
targetList.add(macosArm64("native"))
} else if (currentOs.linux & currentOsArch.amd64) {
targetList.add(linuxX64("native"))
} else if (currentOs.linux & currentOsArch.arm) {
targetList.add(linuxArm64("native"))
}
def target
if (currentOs.macOsX & currentOsArch.amd64) {
target = macosX64("native")
} else if (currentOs.macOsX & currentOsArch.arm) {
target = macosArm64("native")
} else if (currentOs.linux & currentOsArch.amd64) {
target = linuxX64("native")
} else if (currentOs.linux & currentOsArch.arm) {
target =linuxArm64("native")
} else if (currentOs.windows) {
target = mingwX64("native")
} else {
if (currentOs.macOsX) {
targetList.add(macosArm64("native"))
targetList.add(macosX64("native"))
} else if (currentOs.linux) {
targetList.add(linuxArm64("native"))
targetList.add(linuxX64("native"))
}
}
if (currentOs.windows) {
mingwX64("native")
throw new Exception("Unsupported platform.")
}
for (target in targetList) {
target.binaries {
staticLib {
baseName = "lets-plot-${project.name}"
}

target.binaries {
staticLib {
baseName = "lets-plot-${project.name}"
}
target.compilations.main.cinterops {
python {
compilerOpts "-I${project.buildSettings.python.include_path}"
}
}
target.compilations.main.cinterops {
python {
compilerOpts "-I${project.buildSettings.python.include_path}"
}
}

} else {
jvm() // at least one target is required by MPP - dummy jvm target will work just fine
}
Expand Down