mirror of
https://gitlab.alpinelinux.org/alpine/abuild.git
synced 2024-12-25 08:22:19 +00:00
newapkbuild: do out-of-source CMake builds by default
It is recommended by upstream CMake (it will warn when you do in-source builds) to keep generated files away from the source.
This commit is contained in:
parent
d0828c0655
commit
e125a76489
@ -61,7 +61,7 @@ build_cmake() {
|
||||
if [ "\$CBUILD" != "\$CHOST" ]; then
|
||||
CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
|
||||
fi
|
||||
cmake \\
|
||||
cmake -B build \\
|
||||
-DCMAKE_INSTALL_PREFIX=/usr \\
|
||||
-DCMAKE_INSTALL_LIBDIR=lib \\
|
||||
-DBUILD_SHARED_LIBS=True \\
|
||||
@ -69,7 +69,7 @@ build_cmake() {
|
||||
-DCMAKE_CXX_FLAGS="\$CXXFLAGS" \\
|
||||
-DCMAKE_C_FLAGS="\$CFLAGS" \\
|
||||
\${CMAKE_CROSSOPTS} .
|
||||
make
|
||||
make -C build
|
||||
__EOF__
|
||||
}
|
||||
|
||||
@ -124,6 +124,12 @@ check_make() {
|
||||
__EOF__
|
||||
}
|
||||
|
||||
check_cmake() {
|
||||
cat >>APKBUILD<<__EOF__
|
||||
CTEST_OUTPUT_ON_FAILURE=1 make -C build check
|
||||
__EOF__
|
||||
}
|
||||
|
||||
check_python() {
|
||||
cat >>APKBUILD<<__EOF__
|
||||
python3 setup.py test
|
||||
@ -156,6 +162,12 @@ package_make() {
|
||||
__EOF__
|
||||
}
|
||||
|
||||
package_cmake() {
|
||||
cat >>APKBUILD<<__EOF__
|
||||
make -C build DESTDIR="\$pkgdir" install
|
||||
__EOF__
|
||||
}
|
||||
|
||||
package_autotools() {
|
||||
package_make
|
||||
}
|
||||
@ -348,8 +360,10 @@ check() {
|
||||
__EOF__
|
||||
|
||||
case "$buildtype" in
|
||||
make|cmake|autotools|perl)
|
||||
make|autotools|perl)
|
||||
check_make;;
|
||||
cmake)
|
||||
check_cmake;;
|
||||
python)
|
||||
check_python;;
|
||||
rust)
|
||||
@ -369,8 +383,10 @@ package() {
|
||||
__EOF__
|
||||
|
||||
case "$buildtype" in
|
||||
make|cmake)
|
||||
make)
|
||||
package_make;;
|
||||
cmake)
|
||||
package_cmake;;
|
||||
autotools)
|
||||
package_autotools;;
|
||||
meson)
|
||||
|
Loading…
Reference in New Issue
Block a user