Hello
I am running the sample ...\gradle\subprojects\docs\src\samples\native-binaries\cpp\build.gradle
. Since the model defines hello
as a NativeLibrarySpec
,
{
components {
hello(NativeLibrarySpec)
}
}
I am expecting to get 2 main
executables (one, with the shared hello
lib, the other with the static hello
lib) but there is only one
> Task :components
------------------------------------------------------------
Root project
------------------------------------------------------------
Native library 'hello'
----------------------
Source sets
C++ source 'hello:cpp'
srcDir: src\hello\cpp
Binaries
Shared library 'hello:sharedLibrary'
build using task: :helloSharedLibrary
build type: build type 'debug'
flavor: flavor 'default'
target platform: platform 'windows_x86'
tool chain: Tool chain 'visualCpp' (Visual Studio)
shared library file: build\libs\hello\shared\hello.dll
Static library 'hello:staticLibrary'
build using task: :helloStaticLibrary
build type: build type 'debug'
flavor: flavor 'default'
target platform: platform 'windows_x86'
tool chain: Tool chain 'visualCpp' (Visual Studio)
static library file: build\libs\hello\static\hello.lib
Native executable 'main'
------------------------
Source sets
C++ source 'main:cpp'
srcDir: src\main\cpp
Binaries
Executable 'main:executable'
build using task: :mainExecutable
install using task: :installMainExecutable
build type: build type 'debug'
flavor: flavor 'default'
target platform: platform 'windows_x86'
tool chain: Tool chain 'visualCpp' (Visual Studio)
executable file: build\exe\main\main.exe
So, the questions are
- Why Gradle generates only one executable (the one that links with the shared
hello
)
2 What needs to be changed in the script to get the fully staticmain
executable linked with the statichello
lib?