Skip to content
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
2 changes: 2 additions & 0 deletions .evergreen/generated_configs/legacy-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ functions:
set -o errexit
# Build libmongoc with CMake and compile a program that links
# dynamically to it, using variables from pkg-config.exe.
"PATH="/cygdrive/c/ProgramData/chocolatey/lib/winlibs/tools/mingw64/bin:${PATH:-}" # mingw-w64 GCC
cmd.exe /c .\\.evergreen\\scripts\\link-sample-program-mingw.cmd
link sample program MSVC bson:
- command: shell.exec
Expand All @@ -165,6 +166,7 @@ functions:
set -o errexit
# Build libmongoc with CMake and compile a program that links
# dynamically to it, using variables from pkg-config.exe.
"PATH="/cygdrive/c/ProgramData/chocolatey/lib/winlibs/tools/mingw64/bin:${PATH:-}" # mingw-w64 GCC
cmd.exe /c .\\.evergreen\\scripts\\link-sample-program-mingw-bson.cmd
update codecov.io:
- command: shell.exec
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@
r"""
# Build libmongoc with CMake and compile a program that links
# dynamically to it, using variables from pkg-config.exe.
"PATH="/cygdrive/c/ProgramData/chocolatey/lib/winlibs/tools/mingw64/bin:${PATH:-}" # mingw-w64 GCC
cmd.exe /c .\\.evergreen\\scripts\\link-sample-program-mingw.cmd
""",
)
Expand Down Expand Up @@ -185,6 +186,7 @@
r"""
# Build libmongoc with CMake and compile a program that links
# dynamically to it, using variables from pkg-config.exe.
"PATH="/cygdrive/c/ProgramData/chocolatey/lib/winlibs/tools/mingw64/bin:${PATH:-}" # mingw-w64 GCC
cmd.exe /c .\\.evergreen\\scripts\\link-sample-program-mingw-bson.cmd
""",
)
Expand Down
16 changes: 7 additions & 9 deletions .evergreen/scripts/compile-windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,21 +84,19 @@ build_dir="cmake-build"
find_ccache_and_export_vars "$(pwd)" || true

if [[ "${CC}" =~ 'gcc' ]]; then
PATH="/cygdrive/c/ProgramData/chocolatey/lib/winlibs/tools/mingw64/bin:${PATH:-}" # mingw-w64 GCC

export CMAKE_GENERATOR="Ninja"

# MinGW has trouble compiling src/cpp-check.cpp without some assistance.
configure_flags_append "-DCMAKE_CXX_STANDARD=11"

cmake \
-S . \
-B "${build_dir:?}" \
-G "Ninja" \
"${configure_flags[@]}" \
"${extra_configure_flags[@]}"
# mingw-w64 doesn't like lld (hangs indefinitely?).
configure_flags_append "-DMONGO_USE_LLD=OFF"

cmake "${configure_flags[@]}" "${extra_configure_flags[@]}" -B "${build_dir:?}"

cmake --build "${build_dir:?}"
cmake --build "${build_dir:?}" --target mongo_c_driver_tests
cmake --build "${build_dir:?}" --target mongo_c_driver_examples
cmake --build "${build_dir:?}" --target all mongo_c_driver_tests mongo_c_driver_examples
else
# MSBuild task-based parallelism (VS 2019 16.3 and newer).
export UseMultiToolTask=true
Expand Down
2 changes: 1 addition & 1 deletion .evergreen/scripts/link-sample-program-mingw-bson.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ set version=1.31.0
cd %BUILD_DIR% || goto :error

rem Build libmongoc, with flags that the downstream R driver mongolite uses
uvx cmake -G "Ninja" DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% -DCMAKE_C_FLAGS="-pedantic" -DCMAKE_PREFIX_PATH=%INSTALL_DIR%\lib\cmake -DENABLE_STATIC=ON .. || goto :error
uvx cmake -G "Ninja" -DMONGO_USE_LLD=OFF -DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% -DCMAKE_C_FLAGS="-pedantic" -DCMAKE_PREFIX_PATH=%INSTALL_DIR%\lib\cmake -DENABLE_STATIC=ON .. || goto :error
uvx cmake --build . --parallel || goto :error
uvx cmake --build . --target install || goto :error

Expand Down
2 changes: 1 addition & 1 deletion .evergreen/scripts/link-sample-program-mingw.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ set major=1
cd %BUILD_DIR% || goto :error

rem Build libmongoc, with flags that the downstream R driver mongolite uses
uvx cmake -G "Ninja" -DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% -DCMAKE_C_FLAGS="-pedantic" -DCMAKE_PREFIX_PATH=%INSTALL_DIR%\lib\cmake %CMAKE_FLAGS% .. || goto :error
uvx cmake -G "Ninja" -DMONGO_USE_LLD=OFF -DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% -DCMAKE_C_FLAGS="-pedantic" -DCMAKE_PREFIX_PATH=%INSTALL_DIR%\lib\cmake %CMAKE_FLAGS% .. || goto :error
uvx cmake --build . --parallel || goto :error
uvx cmake --build . --target install || goto :error

Expand Down