Skip to content

Commit e3ee8df

Browse files
committed
fix windows
1 parent e2c581b commit e3ee8df

File tree

3 files changed

+30
-17
lines changed

3 files changed

+30
-17
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ jobs:
7272
shell: bash
7373
run: ci/scripts/build_example.sh $(pwd)/example
7474
windows:
75-
name: AMD64 Windows 2019
76-
runs-on: windows-2019
75+
name: AMD64 Windows 2022
76+
runs-on: windows-2022
7777
timeout-minutes: 30
7878
steps:
7979
- name: Checkout iceberg-cpp

ci/scripts/build_example.sh

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

28+
is_windows() {
29+
[[ "${OSTYPE}" == "msys" || "${OSTYPE}" == "win32" ]]
30+
}
31+
2832
CMAKE_ARGS=(
2933
"-DCMAKE_PREFIX_PATH=${CMAKE_INSTALL_PREFIX:-${ICEBERG_HOME}}"
30-
"-DCMAKE_BUILD_TYPE=Debug"
3134
)
3235

33-
BUILD_ARGS=()
34-
35-
# Add Windows-specific toolchain file if on Windows
36-
if [[ "${OSTYPE}" == "msys" || "${OSTYPE}" == "win32" ]]; then
36+
if is_windows; then
3737
CMAKE_ARGS+=("-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake")
38-
BUILD_ARGS+=("--config Debug")
38+
CMAKE_ARGS+=("-DCMAKE_BUILD_TYPE=Release")
39+
else
40+
CMAKE_ARGS+=("-DCMAKE_BUILD_TYPE=Debug")
3941
fi
4042

4143
cmake "${CMAKE_ARGS[@]}" ${source_dir}
42-
cmake --build . "${BUILD_ARGS[@]+"${BUILD_ARGS[@]}"}"
44+
if is_windows; then
45+
cmake --build . --config Release
46+
else
47+
cmake --build .
48+
fi
4349

4450
popd
4551

ci/scripts/build_iceberg.sh

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

28+
is_windows() {
29+
[[ "${OSTYPE}" == "msys" || "${OSTYPE}" == "win32" ]]
30+
}
31+
2832
CMAKE_ARGS=(
2933
"-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX:-${ICEBERG_HOME}}"
3034
"-DICEBERG_BUILD_STATIC=ON"
3135
"-DICEBERG_BUILD_SHARED=ON"
32-
"-DCMAKE_BUILD_TYPE=Debug"
3336
)
3437

35-
BUILD_ARGS=()
36-
37-
# Add Windows-specific toolchain file if on Windows
38-
if [[ "${OSTYPE}" == "msys" || "${OSTYPE}" == "win32" ]]; then
38+
if is_windows; then
3939
CMAKE_ARGS+=("-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake")
40-
BUILD_ARGS+=("--config Debug")
40+
CMAKE_ARGS+=("-DCMAKE_BUILD_TYPE=Release")
41+
else
42+
CMAKE_ARGS+=("-DCMAKE_BUILD_TYPE=Debug")
4143
fi
4244

4345
cmake "${CMAKE_ARGS[@]}" ${source_dir}
44-
cmake --build . "${BUILD_ARGS[@]+"${BUILD_ARGS[@]}"}" --target install
45-
ctest --output-on-failure -C Debug
46+
if is_windows; then
47+
cmake --build . --config Release --target install
48+
ctest --output-on-failure -C Release
49+
else
50+
cmake --build . --target install
51+
ctest --output-on-failure
52+
fi
4653

4754
popd
4855

0 commit comments

Comments
 (0)