Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.20] Build with CMake on unix #127

Merged
merged 19 commits into from
Sep 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .azure-pipelines/azure-pipelines-linux.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .ci_support/linux_aarch64_.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ cxx_compiler:
cxx_compiler_version:
- '10'
docker_image:
- quay.io/condaforge/linux-anvil-aarch64
- quay.io/condaforge/linux-anvil-cos7-x86_64
pin_run_as_build:
zlib:
max_pin: x.x
Expand Down
4 changes: 2 additions & 2 deletions .ci_support/osx_64_.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ MACOSX_DEPLOYMENT_TARGET:
c_compiler:
- clang
c_compiler_version:
- '13'
- '14'
channel_sources:
- conda-forge
channel_targets:
- conda-forge main
cxx_compiler:
- clangxx
cxx_compiler_version:
- '13'
- '14'
macos_machine:
- x86_64-apple-darwin13.4.0
pin_run_as_build:
Expand Down
4 changes: 2 additions & 2 deletions .ci_support/osx_arm64_.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ MACOSX_DEPLOYMENT_TARGET:
c_compiler:
- clang
c_compiler_version:
- '13'
- '14'
channel_sources:
- conda-forge
channel_targets:
- conda-forge main
cxx_compiler:
- clangxx
cxx_compiler_version:
- '13'
- '14'
macos_machine:
- arm64-apple-darwin20.0.0
pin_run_as_build:
Expand Down
4 changes: 2 additions & 2 deletions .ci_support/win_64_.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
c_compiler:
- vs2017
- vs2019
channel_sources:
- conda-forge
channel_targets:
- conda-forge main
cxx_compiler:
- vs2017
- vs2019
pin_run_as_build:
zlib:
max_pin: x.x
Expand Down
22 changes: 0 additions & 22 deletions .travis.yml

This file was deleted.

11 changes: 3 additions & 8 deletions README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion conda-forge.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
provider: {linux_aarch64: default, linux_ppc64le: default, win: azure}
conda_forge_output_validation: true
build_platform: {osx_arm64: osx_64, linux_ppc64le: linux_64}
build_platform: {osx_arm64: osx_64, linux_aarch64: linux_64, linux_ppc64le: linux_64}
test_on_native_only: true
bot:
automerge: true
Expand Down
21 changes: 0 additions & 21 deletions recipe/bld-shared.bat

This file was deleted.

23 changes: 14 additions & 9 deletions recipe/bld-static.bat → recipe/build-lib.bat
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
@echo on

:: Setup directory structure per protobuf's instructions.
cd cmake
if errorlevel 1 exit 1

mkdir build-static
if errorlevel 1 exit 1
cd build-static
if errorlevel 1 exit 1
if "%PKG_NAME%"=="libprotobuf-static" (
set CF_SHARED=OFF
mkdir build-static
cd build-static
) else (
set CF_SHARED=ON
mkdir build-shared
cd build-shared
)

:: Configure and install based on protobuf's instructions and other `bld.bat`s.
cmake -G "Ninja" ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX% ^
-DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^
-Dprotobuf_WITH_ZLIB=ON ^
-Dprotobuf_BUILD_SHARED_LIBS=OFF ^
-Dprotobuf_BUILD_SHARED_LIBS=%CF_SHARED% ^
-Dprotobuf_MSVC_STATIC_RUNTIME=OFF ^
..
if errorlevel 1 exit 1
if %ERRORLEVEL% neq 0 exit 1
cmake --build . --target install --config Release
if errorlevel 1 exit 1

if %ERRORLEVEL% neq 0 exit 1
53 changes: 53 additions & 0 deletions recipe/build-lib.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/bash
set -ex

if [ "$(uname)" == "Linux" ];
then
# protobuf uses PROTOBUF_OPT_FLAG to set the optimization level
# unit test can fail if optmization above 0 are used.
CPPFLAGS="${CPPFLAGS//-O[0-9]/}"
CXXFLAGS="${CXXFLAGS//-O[0-9]/}"
export PROTOBUF_OPT_FLAG="-O2"
# to improve performance, disable checks intended for debugging
CXXFLAGS="$CXXFLAGS -DNDEBUG"
elif [ "$(uname)" == "Darwin" ];
then
# remove pie from LDFLAGS
LDFLAGS="${LDFLAGS//-pie/}"
fi

# required to pick up conda installed zlib
export CPPFLAGS="${CPPFLAGS} -I${PREFIX}/include"
export LDFLAGS="${LDFLAGS} -L${PREFIX}/lib"

# Setup directory structure per protobuf's instructions.
cd cmake

if [[ "$PKG_NAME" == "libprotobuf-static" ]]; then
export CF_SHARED=OFF
mkdir build-static
cd build-static
else
export CF_SHARED=ON
mkdir build-shared
cd build-shared
fi

if [[ "$CONDA_BUILD_CROSS_COMPILATION" == 1 ]]; then
export CMAKE_ARGS="${CMAKE_ARGS} -Dprotobuf_BUILD_TESTS=OFF"
fi

cmake -G "Ninja" \
${CMAKE_ARGS} \
-DCMAKE_BUILD_TYPE=Release \
-Dprotobuf_WITH_ZLIB=ON \
-Dprotobuf_BUILD_SHARED_LIBS=$CF_SHARED \
..

cmake --build .

if [[ "$CONDA_BUILD_CROSS_COMPILATION" != 1 ]]; then
ninja check
fi

cmake --install .
54 changes: 0 additions & 54 deletions recipe/build-shared.sh

This file was deleted.

7 changes: 0 additions & 7 deletions recipe/build_static.sh

This file was deleted.

Loading