Skip to content
Open
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
23 changes: 8 additions & 15 deletions ci/scripts/build_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,26 +38,19 @@ CMAKE_ARGS=(

if is_windows; then
CMAKE_ARGS+=("-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake")
CMAKE_ARGS+=("-DCMAKE_BUILD_TYPE=Release")
else
CMAKE_ARGS+=("-DCMAKE_BUILD_TYPE=Debug")
fi

build_type="${ICEBERG_BUILD_TYPE:-Debug}"
CMAKE_ARGS+=("-DCMAKE_BUILD_TYPE=${build_type}")

cmake "${CMAKE_ARGS[@]}" ${source_dir}
if is_windows; then
cmake --build . --config Release
if [[ "${run_example}" == "ON" ]]; then
if [[ -x ./demo_example.exe ]]; then
./demo_example.exe
cmake --build .
if [[ "${run_example}" == "ON" ]]; then
if is_windows; then
./demo_example.exe
else
./Release/demo_example.exe
./demo_example
fi
fi
else
cmake --build .
if [[ "${run_example}" == "ON" ]]; then
./demo_example
fi
fi

popd
28 changes: 11 additions & 17 deletions ci/scripts/build_iceberg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,16 @@ else
fi

if is_windows; then
CMAKE_ARGS+=("-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake")
CMAKE_ARGS+=("-DCMAKE_BUILD_TYPE=Release")
else
# Pass an externally provided toolchain (e.g. vcpkg for the SigV4 job)
if [[ -n "${CMAKE_TOOLCHAIN_FILE:-}" ]]; then
CMAKE_ARGS+=("-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
fi
CMAKE_ARGS+=("-DCMAKE_BUILD_TYPE=Debug")
CMAKE_TOOLCHAIN_FILE="${CMAKE_TOOLCHAIN_FILE:-C:/vcpkg/scripts/buildsystems/vcpkg.cmake}"
fi

# Pass an externally provided toolchain, or the default Windows vcpkg toolchain.
if [[ -n "${CMAKE_TOOLCHAIN_FILE:-}" ]]; then
CMAKE_ARGS+=("-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
fi

CMAKE_ARGS+=("-DCMAKE_BUILD_TYPE=${ICEBERG_BUILD_TYPE:-Debug}")

if [[ "${build_enable_sccache}" == "ON" ]]; then
CMAKE_ARGS+=("-DCMAKE_CXX_COMPILER_LAUNCHER=sccache")
CMAKE_ARGS+=("-DCMAKE_C_COMPILER_LAUNCHER=sccache")
Expand All @@ -85,16 +85,10 @@ if [[ -n "${ICEBERG_EXTRA_CMAKE_ARGS:-}" ]]; then
fi

cmake "${CMAKE_ARGS[@]}" ${source_dir}
if is_windows; then
cmake --build . --config Release --target install
if [[ "${run_tests}" == "ON" ]]; then
ctest --output-on-failure -C Release
fi
else
cmake --build . --target install
if [[ "${run_tests}" == "ON" ]]; then

cmake --build . --target install
if [[ "${run_tests}" == "ON" ]]; then
ctest --output-on-failure
fi
fi

popd
Expand Down
21 changes: 7 additions & 14 deletions cmake_modules/IcebergSccache.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,12 @@
if(MSVC_TOOLCHAIN AND "${CMAKE_CXX_COMPILER_LAUNCHER}" STREQUAL "sccache")
message(STATUS "Configuring sccache for MSVC")

# Remove /Zi or /ZI
string(REGEX REPLACE "/Z[iI]" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
string(REGEX REPLACE "/Z[iI]" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
# Keep MSVC Debug objects cacheable by sccache without affecting Release.
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<$<CONFIG:Debug,RelWithDebInfo>:Embedded>")

string(REGEX REPLACE "/Z[iI]" "" CMAKE_C_FLAGS_RELWITHDEBINFO
"${CMAKE_C_FLAGS_RELWITHDEBINFO}")
string(REGEX REPLACE "/Z[iI]" "" CMAKE_CXX_FLAGS_RELWITHDEBINFO
"${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")

# Add /Z7
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /Z7")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Z7")

set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /Z7")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Z7")
# CMP0141 normally handles these flags; normalize any flags injected elsewhere.
foreach(flag_var CMAKE_C_FLAGS_DEBUG CMAKE_CXX_FLAGS_DEBUG CMAKE_C_FLAGS_RELWITHDEBINFO
CMAKE_CXX_FLAGS_RELWITHDEBINFO)
string(REGEX REPLACE "/Z[iI]" "/Z7" ${flag_var} "${${flag_var}}")
endforeach()
endif()
3 changes: 1 addition & 2 deletions src/iceberg/test/scan_test_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ class ScanTestBase : public testing::TestWithParam<int8_t> {
std::shared_ptr<PartitionSpec> spec = nullptr) {
std::vector<std::pair<std::string, PartitionValues>> files_with_partitions;
for (const auto& path : added_files) {
files_with_partitions.emplace_back(path, kEmptyPartition);
files_with_partitions.emplace_back(path, PartitionValues{});
}
return MakeAppendSnapshotWithPartitionValues(format_version, snapshot_id,
parent_snapshot_id, sequence_number,
Expand Down Expand Up @@ -350,7 +350,6 @@ class ScanTestBase : public testing::TestWithParam<int8_t> {
private:
int manifest_counter_ = 0;
int manifest_list_counter_ = 0;
constexpr static PartitionValues kEmptyPartition{};
};

} // namespace iceberg
Loading