Skip to content
Closed
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
10 changes: 5 additions & 5 deletions ci/scripts/build_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +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
cmake --build . --config "${build_type}"
if [[ "${run_example}" == "ON" ]]; then
if [[ -x ./demo_example.exe ]]; then
./demo_example.exe
else
./Release/demo_example.exe
./"${build_type}"/demo_example.exe
fi
fi
else
Expand Down
22 changes: 12 additions & 10 deletions ci/scripts/build_iceberg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ CMAKE_ARGS=(
"-G Ninja"
"-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX:-${ICEBERG_HOME}}"
"-DICEBERG_BUILD_STATIC=ON"
"-DICEBERG_BUILD_SHARED=ON"
"-DICEBERG_BUILD_SHARED=OFF"
"-DICEBERG_BUILD_REST_INTEGRATION_TESTS=${build_rest_integration_test}"
)

Expand All @@ -65,15 +65,15 @@ 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")
fi

# 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=${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,10 +85,12 @@ if [[ -n "${ICEBERG_EXTRA_CMAKE_ARGS:-}" ]]; then
fi

cmake "${CMAKE_ARGS[@]}" ${source_dir}

build_type="${ICEBERG_BUILD_TYPE:-Debug}"
if is_windows; then
cmake --build . --config Release --target install
cmake --build . --config "${build_type}" --target install
if [[ "${run_tests}" == "ON" ]]; then
ctest --output-on-failure -C Release
ctest --output-on-failure -C "${build_type}"
fi
else
cmake --build . --target install
Expand Down
25 changes: 11 additions & 14 deletions cmake_modules/IcebergSccache.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,19 @@
# specific language governing permissions and limitations
# under the License.

if(MSVC_TOOLCHAIN AND "${CMAKE_CXX_COMPILER_LAUNCHER}" STREQUAL "sccache")
message(STATUS "Configuring sccache for MSVC")
if(MSVC_TOOLCHAIN)
message(STATUS "Embedding debug info (/Z7) on MSVC to avoid PDB lock contention with Ninja")

# 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}")
# CMake 3.25+ policy: force /Z7 (Embedded) for ALL targets including FetchContent deps.
# Without this, vendored Boost uses /Zi which races on the shared .pdb under Ninja.
cmake_policy(SET CMP0141 NEW)
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT Embedded)

string(REGEX REPLACE "/Z[iI]" "" CMAKE_C_FLAGS_RELWITHDEBINFO
# Belt-and-suspenders: also patch the default flag strings for older CMake code paths.
string(REGEX REPLACE "/Z[iI]" "/Z7" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
string(REGEX REPLACE "/Z[iI]" "/Z7" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
string(REGEX REPLACE "/Z[iI]" "/Z7" CMAKE_C_FLAGS_RELWITHDEBINFO
"${CMAKE_C_FLAGS_RELWITHDEBINFO}")
string(REGEX REPLACE "/Z[iI]" "" CMAKE_CXX_FLAGS_RELWITHDEBINFO
string(REGEX REPLACE "/Z[iI]" "/Z7" 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")
endif()
5 changes: 3 additions & 2 deletions src/iceberg/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ if(ICEBERG_BUILD_SQL_CATALOG
target_include_directories(sql_catalog_test PRIVATE "${CMAKE_BINARY_DIR}/iceberg/test/")
target_sources(sql_catalog_test PRIVATE sql_catalog_test.cc)
target_link_libraries(sql_catalog_test
PRIVATE iceberg_sql_catalog_static
PRIVATE "$<IF:$<TARGET_EXISTS:iceberg_sql_catalog_static>,iceberg_sql_catalog_static,iceberg_sql_catalog_shared>"
"$<IF:$<TARGET_EXISTS:iceberg_bundle_static>,iceberg_bundle_static,iceberg_bundle_shared>"
GTest::gmock_main)
if(MSVC_TOOLCHAIN)
Expand All @@ -287,7 +287,8 @@ if(ICEBERG_BUILD_REST)
add_executable(${test_name})
target_include_directories(${test_name} PRIVATE "${CMAKE_BINARY_DIR}/iceberg/test/")
target_sources(${test_name} PRIVATE ${ARG_SOURCES})
target_link_libraries(${test_name} PRIVATE GTest::gmock_main iceberg_rest_static)
target_link_libraries(${test_name} PRIVATE GTest::gmock_main
"$<IF:$<TARGET_EXISTS:iceberg_rest_static>,iceberg_rest_static,iceberg_rest_shared>")
if(MSVC_TOOLCHAIN)
target_compile_options(${test_name} PRIVATE /bigobj)
endif()
Expand Down
2 changes: 1 addition & 1 deletion src/iceberg/test/scan_test_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ class ScanTestBase : public testing::TestWithParam<int8_t> {
private:
int manifest_counter_ = 0;
int manifest_list_counter_ = 0;
constexpr static PartitionValues kEmptyPartition{};
inline static const PartitionValues kEmptyPartition{};
};

} // namespace iceberg
1 change: 1 addition & 0 deletions src/iceberg/util/string_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#pragma once

#include <algorithm>
#include <cassert>
#include <cctype>
#include <cerrno>
#include <charconv>
Expand Down
Loading