@@ -13,6 +13,7 @@ version = rootProject.version
1313description = rootProject.description
1414
1515val artifactName = " luau-natives-${getOsName()} -${getArchName()} "
16+ val buildType: String by project.extra { " Release" }
1617
1718val buildProjectDir = file(layout.buildDirectory.file(" root" ).get())
1819
@@ -69,10 +70,12 @@ tasks.register<Exec>("prepNative") {
6970 val cmake: String? by project.extra
7071 val args = mutableListOf (
7172 cmake ? : throw IllegalStateException (" cmake not found on path" ),
73+ " -DCMAKE_BUILD_TYPE=${buildType} " , " -DCMAKE_POSITION_INDEPENDENT_CODE=ON" ,
74+ // We don't control the library so warnings are kinda irrelevant. can just suppress.
75+ " -DCMAKE_CXX_FLAGS=-w" , " -DCMAKE_C_FLAGS=-w" ,
76+ // Just need the libraries themselves, not the extras.
77+ " -DLUAU_BUILD_CLI=OFF" , " -DLUAU_BUILD_TESTS=OFF" ,
7278 " -DLUAU_EXTERN_C=ON" ,
73- " -DLUAU_BUILD_CLI=OFF" ,
74- " -DLUAU_BUILD_TESTS=OFF" ,
75- " -DCMAKE_POSITION_INDEPENDENT_CODE=ON" ,
7679 " -B" , " ." ,
7780 " -S" , buildProjectDir
7881 )
@@ -101,8 +104,8 @@ tasks.register<Exec>("buildNative") {
101104tasks.register<Copy >(" copyNative" ) {
102105 dependsOn(" buildNative" )
103106
104- var libPath = " cmake/lib" // todo it should definitely be a release build. need to do that.
105- if (getOsName() == " windows" ) libPath + = " /Debug "
107+ var libPath = " cmake/lib"
108+ if (getOsName() == " windows" ) libPath + = " /${buildType} "
106109 from(file(layout.buildDirectory).resolve(libPath))
107110 into(file(layout.buildDirectory).resolve(" nres/net/hollowcube/luau/${getOsName()} /${getArchName()} " ))
108111}
0 commit comments