diff --git a/recipes/dev/cmake/recipe.toml b/recipes/dev/cmake/recipe.toml index 4425cd336..b888557bc 100644 --- a/recipes/dev/cmake/recipe.toml +++ b/recipes/dev/cmake/recipe.toml @@ -24,7 +24,7 @@ DYNAMIC_INIT export LDFLAGS="-Wl,-rpath-link,${COOKBOOK_SYSROOT}/lib $LDFLAGS" -COOKBOOK_CMAKE_FLAGS=( +COOKBOOK_CMAKE_FLAGS+=( -DBUILD_TESTING=Off -DCMAKE_USE_SYSTEM_BZIP2=On -DCMAKE_USE_SYSTEM_CURL=On diff --git a/recipes/dev/llvm18/recipe.toml b/recipes/dev/llvm18/recipe.toml index da8be3e49..1834a94e3 100644 --- a/recipes/dev/llvm18/recipe.toml +++ b/recipes/dev/llvm18/recipe.toml @@ -31,7 +31,7 @@ case "${TARGET}" in ;; esac -COOKBOOK_CMAKE_FLAGS=( +COOKBOOK_CMAKE_FLAGS+=( -DCMAKE_CXX_FLAGS="--std=gnu++11" -DBUILD_SHARED_LIBS=False -DLLVM_LINK_LLVM_DYLIB=On diff --git a/recipes/games/eduke32/recipe.toml b/recipes/games/eduke32/recipe.toml index 29616fba0..79cd4a579 100644 --- a/recipes/games/eduke32/recipe.toml +++ b/recipes/games/eduke32/recipe.toml @@ -23,7 +23,7 @@ export CFLAGS="-I${COOKBOOK_SYSROOT}/include -I${COOKBOOK_SYSROOT}/include/SDL" export SDLCONFIG="${COOKBOOK_SYSROOT}/bin/sdl-config --prefix=${COOKBOOK_SYSROOT}" export LDFLAGS="-L${COOKBOOK_SYSROOT}/lib" -if [[ -n "${COOKBOOK_PREFER_STATIC}" ]]; then +if [ "${COOKBOOK_DYNAMIC}" != "1" ]; then LDFLAGS+=" -static" fi diff --git a/recipes/games/opentyrian/recipe.toml b/recipes/games/opentyrian/recipe.toml index d20cecf32..ba168fb22 100644 --- a/recipes/games/opentyrian/recipe.toml +++ b/recipes/games/opentyrian/recipe.toml @@ -38,7 +38,7 @@ export bindir="${prefix}/games" export icondir="/ui/icons/apps" export gamesdir="${prefix}/share/games" -if ! [[ -n "${COOKBOOK_PREFER_STATIC}" ]]; then +if [ "${COOKBOOK_DYNAMIC}" == "1" ]; then LDFLAGS+=" -lstdc++" fi diff --git a/recipes/games/quakespasm/recipe.toml b/recipes/games/quakespasm/recipe.toml index f101e8975..58cefddb9 100644 --- a/recipes/games/quakespasm/recipe.toml +++ b/recipes/games/quakespasm/recipe.toml @@ -39,7 +39,7 @@ export USE_SDL2=1 export USE_CODEC_MP3=0 export DO_USERDIRS=1 -if ! [[ -n "${COOKBOOK_PREFER_STATIC}" ]]; then +if [ "${COOKBOOK_DYNAMIC}" == "1" ]; then LDFLAGS+=" -lstdc++" fi diff --git a/recipes/libs/libjpeg/recipe.toml b/recipes/libs/libjpeg/recipe.toml index 646a06b7f..b7b417412 100644 --- a/recipes/libs/libjpeg/recipe.toml +++ b/recipes/libs/libjpeg/recipe.toml @@ -6,6 +6,6 @@ blake3 = "3efc14da55c56fc0a6a50f109d9e1ee8a91f5ae7dd17a21d3aebe04a65f3ee96" [build] template = "custom" script = """ -DYNAMIC_INIT +DYNAMIC_STATIC_INIT cookbook_cmake """ diff --git a/recipes/libs/libuv/recipe.toml b/recipes/libs/libuv/recipe.toml index dcef35ca4..d6b4f9579 100644 --- a/recipes/libs/libuv/recipe.toml +++ b/recipes/libs/libuv/recipe.toml @@ -8,7 +8,7 @@ template = "custom" script = """ DYNAMIC_INIT -COOKBOOK_CMAKE_FLAGS=( +COOKBOOK_CMAKE_FLAGS+=( -DBUILD_TESTING=Off ) cookbook_cmake diff --git a/recipes/libs/mesa/recipe.toml b/recipes/libs/mesa/recipe.toml index d581c1b31..596010812 100644 --- a/recipes/libs/mesa/recipe.toml +++ b/recipes/libs/mesa/recipe.toml @@ -17,27 +17,19 @@ export CFLAGS+=" -DHAVE_PTHREAD=1" export CPPFLAGS+=" -DHAVE_PTHREAD=1" export LLVM_CONFIG="${TARGET}-llvm-config" -if [[ -n "${COOKBOOK_PREFER_STATIC}" ]]; then - export LDFLAGS+=" --static" - export DEFAULTLIB="static" - export LLVMSHARED="disabled" +if [ "${COOKBOOK_DYNAMIC}" == "1" ]; then + COOKBOOK_MESON_FLAGS+=(-Dshared-llvm=enabled) else - export DEFAULTLIB="shared" - export LLVMSHARED="enabled" + COOKBOOK_MESON_FLAGS+=(-Dshared-llvm=disabled) fi -COOKBOOK_MESON_FLAGS=( - -Ddefault_library="${DEFAULTLIB}" - -Dglx=disabled - -Dllvm=enabled - -Dosmesa=true - -Dplatforms= - -Dshader-cache=disabled - -Dshared-llvm="${LLVMSHARED}" +cookbook_meson \ + -Dglx=disabled \ + -Dllvm=enabled \ + -Dosmesa=true \ + -Dplatforms= \ + -Dshader-cache=disabled \ -Dshared-glapi=disabled -) - -cookbook_meson # Hack to add LLVM libs #TODO: only add necessary LLVM libs, not all of them diff --git a/recipes/wip/dev/other/protobuf/recipe.toml b/recipes/wip/dev/other/protobuf/recipe.toml index f0827b2a5..7c90d4522 100644 --- a/recipes/wip/dev/other/protobuf/recipe.toml +++ b/recipes/wip/dev/other/protobuf/recipe.toml @@ -13,7 +13,7 @@ dependencies = [ ] script = """ DYNAMIC_INIT -COOKBOOK_CMAKE_FLAGS=( +COOKBOOK_CMAKE_FLAGS+=( -Dprotobuf_BUILD_TESTS=OFF ) cookbook_cmake diff --git a/src/bin/cook.rs b/src/bin/cook.rs index 365e7315e..4ec65240f 100644 --- a/src/bin/cook.rs +++ b/src/bin/cook.rs @@ -228,6 +228,12 @@ function DYNAMIC_INIT { --disable-static ) + COOKBOOK_CMAKE_FLAGS=( + -DBUILD_SHARED_LIBS=True + -DENABLE_SHARED=True + -DENABLE_STATIC=False + ) + COOKBOOK_MESON_FLAGS=( --buildtype release --wrap-mode nofallback @@ -255,6 +261,12 @@ function DYNAMIC_STATIC_INIT { --enable-static ) + COOKBOOK_CMAKE_FLAGS=( + -DBUILD_SHARED_LIBS=True + -DENABLE_SHARED=True + -DENABLE_STATIC=True + ) + COOKBOOK_MESON_FLAGS=( --buildtype release --wrap-mode nofallback @@ -927,6 +939,11 @@ function cookbook_configure { COOKBOOK_CMAKE="cmake" COOKBOOK_NINJA="ninja" +COOKBOOK_CMAKE_FLAGS=( + -DBUILD_SHARED_LIBS=False + -DENABLE_SHARED=False + -DENABLE_STATIC=True +) function cookbook_cmake { cat > cross_file.cmake <