Skip to content

Commit be6f8d2

Browse files
committed
fix ci
1 parent 923bf15 commit be6f8d2

File tree

5 files changed

+39
-52
lines changed

5 files changed

+39
-52
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888
shell: cmd
8989
run: |
9090
call "C:\Program Files (x86)\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
91-
bash -c "ci/scripts/build_iceberg_windows.sh $(pwd)
91+
bash -c "ci/scripts/build_iceberg.sh $(pwd)
9292
- name: Build Example
9393
shell: cmd
9494
run: |

ci/scripts/build_example.sh

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,21 @@ build_dir=${1}/build
2525
mkdir ${build_dir}
2626
pushd ${build_dir}
2727

28-
cmake \
29-
-DCMAKE_PREFIX_PATH=${CMAKE_INSTALL_PREFIX:-${ICEBERG_HOME}} \
30-
${source_dir}
31-
cmake --build .
28+
CMAKE_ARGS=(
29+
"-DCMAKE_PREFIX_PATH=${CMAKE_INSTALL_PREFIX:-${ICEBERG_HOME}}"
30+
"-DCMAKE_BUILD_TYPE=Debug"
31+
)
32+
33+
BUILD_ARGS=()
34+
35+
# Add Windows-specific toolchain file if on Windows
36+
if [[ "${OSTYPE}" == "msys" || "${OSTYPE}" == "win32" ]]; then
37+
CMAKE_ARGS+=("-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake")
38+
BUILD_ARGS+=("--config Debug")
39+
fi
40+
41+
cmake "${CMAKE_ARGS[@]}" ${source_dir}
42+
cmake --build . "${BUILD_ARGS[@]+"${BUILD_ARGS[@]}"}"
3243

3344
popd
3445

ci/scripts/build_iceberg.sh

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,23 @@ build_dir=${1}/build
2525
mkdir ${build_dir}
2626
pushd ${build_dir}
2727

28-
cmake \
29-
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX:-${ICEBERG_HOME}} \
30-
-DICEBERG_BUILD_STATIC=ON \
31-
-DICEBERG_BUILD_SHARED=ON \
32-
${source_dir}
33-
cmake --build . --target install
28+
CMAKE_ARGS=(
29+
"-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX:-${ICEBERG_HOME}}"
30+
"-DICEBERG_BUILD_STATIC=ON"
31+
"-DICEBERG_BUILD_SHARED=ON"
32+
"-DCMAKE_BUILD_TYPE=Debug"
33+
)
34+
35+
BUILD_ARGS=()
36+
37+
# Add Windows-specific toolchain file if on Windows
38+
if [[ "${OSTYPE}" == "msys" || "${OSTYPE}" == "win32" ]]; then
39+
CMAKE_ARGS+=("-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake")
40+
BUILD_ARGS+=("--config Debug")
41+
fi
42+
43+
cmake "${CMAKE_ARGS[@]}" ${source_dir}
44+
cmake --build . "${BUILD_ARGS[@]+"${BUILD_ARGS[@]}"}" --target install
3445
ctest --output-on-failure -C Debug
3546

3647
popd

ci/scripts/build_iceberg_windows.sh

Lines changed: 0 additions & 40 deletions
This file was deleted.

cmake_modules/IcebergThirdpartyToolchain.cmake

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,14 +171,19 @@ function(resolve_avro_dependency)
171171

172172
set(AVRO_VENDORED TRUE)
173173
set_target_properties(avrocpp_s PROPERTIES OUTPUT_NAME "iceberg_vendored_avrocpp")
174+
set_target_properties(avrocpp_s PROPERTIES POSITION_INDEPENDENT_CODE ON)
174175
install(TARGETS avrocpp_s
175176
EXPORT iceberg_targets
176177
RUNTIME DESTINATION "${ICEBERG_INSTALL_BINDIR}"
177178
ARCHIVE DESTINATION "${ICEBERG_INSTALL_LIBDIR}"
178179
LIBRARY DESTINATION "${ICEBERG_INSTALL_LIBDIR}")
179180

180181
# TODO: add vendored ZLIB and Snappy support
181-
list(APPEND ICEBERG_SYSTEM_DEPENDENCIES ZLIB Snappy)
182+
find_package(Snappy CONFIG)
183+
if(Snappy_FOUND)
184+
list(APPEND ICEBERG_SYSTEM_DEPENDENCIES Snappy)
185+
endif()
186+
list(APPEND ICEBERG_SYSTEM_DEPENDENCIES ZLIB)
182187
else()
183188
set(AVRO_VENDORED FALSE)
184189
list(APPEND ICEBERG_SYSTEM_DEPENDENCIES Avro)

0 commit comments

Comments
 (0)