I have a kotlin native project with only a main mo...
# gradle
a
I have a kotlin native project with only a main module and a test module. How do I make it so that the test module inherits the dependencies of the main module, and how do I make it so that both executables have the same compiler args? I've overridden the compiler args as such
Copy code
val nativeTarget = when (System.getProperty("os.name")) {
        "Linux" -> linuxX64("native")
        else -> throw GradleException("Host OS is not supported.")
    }

    nativeTarget.apply {
        compilations.getByName("main") {
            cinterops {
                val openssl by creating {
                    defFile(project.file("src/cinterop/openssl.def"))
                }
            }
        }

        binaries {
            executable {
                // Use system C libraries
                val sysRoot = "/"
                val libgccRoot = File("/lib/gcc/x86_64-linux-gnu/").takeIf { it.exists() }
                    ?: File("/lib/gcc/x86_64-pc-linux-gnu/")
                // Use the most recent GCC available on the host
                val libgccPath = file("${libgccRoot.absolutePath}/${libgccRoot.list()!!.last()}")
                val overriddenProperties =
                    "targetSysRoot.linux_x64=$sysRoot;libGcc.linux_x64=$libgccPath"
                val compilerArgs = "-Xoverride-konan-properties=$overriddenProperties"
                this.freeCompilerArgs += listOf(compilerArgs)
                this.entryPoint = "opstopus.deploptopus.main"
        }
    }