Skip to content

Commit

Permalink
parse version string for free-threaded build
Browse files Browse the repository at this point in the history
  • Loading branch information
bjia56 authored Dec 13, 2024
1 parent 34a626f commit e404b70
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions scripts/build_cosmo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ mkdir python-install
cd python-build
cmake \
"${cmake_verbose_flags[@]}" \
"${cmake_python_options[@]}" \
-DCMAKE_C_COMPILER=${CC} \
-DCMAKE_CXX_COMPILER=${CXX} \
-DCMAKE_CXX_FLAGS="${CXXFLAGS}" \
Expand Down
1 change: 1 addition & 0 deletions scripts/build_freebsd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ mkdir python-install
cd python-build
cmake \
"${cmake_verbose_flags[@]}" \
"${cmake_python_options[@]}" \
-DCMAKE_IGNORE_PATH=/usr/include \
-DPYTHON_VERSION=${PYTHON_FULL_VER} \
-DPORTABLE_PYTHON_BUILD=ON \
Expand Down
1 change: 1 addition & 0 deletions scripts/build_linux_zig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,7 @@ mkdir python-install
cd python-build
LDFLAGS="${LDFLAGS} -lfontconfig -lfreetype" cmake \
"${cmake_verbose_flags[@]}" \
"${cmake_python_options[@]}" \
-DCMAKE_SYSTEM_PROCESSOR=${ARCH} \
-DCMAKE_CROSSCOMPILING_EMULATOR=${WORKDIR}/scripts/qemu_${ARCH}_interpreter \
-DCMAKE_IGNORE_PATH=/usr/include \
Expand Down
1 change: 1 addition & 0 deletions scripts/build_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ mkdir python-install
cd python-build
cmake \
"${cmake_verbose_flags[@]}" \
"${cmake_python_options[@]}" \
-G "Unix Makefiles" \
"-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64" \
-DCMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} \
Expand Down
1 change: 1 addition & 0 deletions scripts/build_solaris.sh
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,7 @@ cd python-build
# https://stackoverflow.com/a/52240320
CFLAGS="${CFLAGS} -D_XOPEN_SOURCE=500 -D__EXTENSIONS__" LDFLAGS="${LDFLAGS} -lsocket -lnsl" cmake \
"${cmake_verbose_flags[@]}" \
"${cmake_python_options[@]}" \
-DCMAKE_IGNORE_PATH=/usr/include \
-DPYTHON_VERSION=${PYTHON_FULL_VER} \
-DPORTABLE_PYTHON_BUILD=ON \
Expand Down
1 change: 1 addition & 0 deletions scripts/build_windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ mkdir python-install
cd python-build
cmake \
"${cmake_verbose_flags[@]}" \
"${cmake_python_options[@]}" \
-G "Visual Studio 17 2022" -A x64 \
-DPYTHON_VERSION=${PYTHON_FULL_VER} \
-DPORTABLE_PYTHON_BUILD=ON \
Expand Down
8 changes: 8 additions & 0 deletions scripts/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ fi

ARCH=$1
PYTHON_FULL_VER=$2

cmake_python_options=()
# Parse Python options out of full version string
if [[ "${PYTHON_FULL_VER}" == *t ]]; then
PYTHON_FULL_VER=${PYTHON_FULL_VER%"t"}
cmake_python_options+=(-DWITH_FREE_THREADING)
fi

DISTRIBUTION=$3
PYTHON_VER=$(echo ${PYTHON_FULL_VER} | cut -d "." -f 1-2)
PYTHON_MAJOR=$(echo ${PYTHON_VER} | cut -d "." -f 1)
Expand Down

0 comments on commit e404b70

Please sign in to comment.