Files
rapidyaml/.github/mingw-w64-x86_64.cmake
Joao Paulo Magalhaes 2fcd2d410d re #486: trying to reproduce:
no luck so far with any of the following:

native gcc11.4 on ubuntu22.04:
```
( \
set -xe ; \
cd /rapidyaml/ ; \
bt=Release ; \
bd=build/docker-$bt ; \
tgt=ryml-test-scalar_dquoted ; \
export C4_EXTERN_DIR=`pwd`/build/extern ; \
mkdir -p $C4_EXTERN_DIR ; \
cmake -B $bd -D RYML_DEV=ON -D RYML_BUILD_BENCHMARKS=OFF && \
cmake --build $bd -j --target $tgt && \
./$bd/test/$tgt --gtest_filter=*486* )
```

Tried also using -DRYML_STRICT_ALIASING=OFF (to remove
-fstrict-aliasing) and -DRYML_PEDANTIC=OFF, and still could not
reproduce.

with wine in arch linux (gcc 14):
```
( set -xe ; \
bt=Release ; \
bd=build/mingw-$bt ; \
tgt=ryml-test-scalar_dquoted ; \
cd ~/proj/rapidyaml/ ; \
cmake -B $bd -D
CMAKE_TOOLCHAIN_FILE=`pwd`/.github/mingw-w64-x86_64.cmake -D RYML_DEV=ON && \
cmake --build $bd -j --target $tgt && \
env WINEPATH=/usr/x86_64-w64-mingw32/bin wine ./$bd/bin/$tgt.exe --gtest_filter=*486* )
```
with wine in ubuntu18.04 (gcc 7.3)
```
( set -xe ; \
cd /rapidyaml/ ; \
bt=Release ; \
bd=build/docker-mingw-$bt ; \
tgt=ryml-test-scalar_dquoted ; \
export C4_EXTERN_DIR=`pwd`/build/extern ; \
mkdir -p $C4_EXTERN_DIR ; \
cmake -B $bd -D
CMAKE_TOOLCHAIN_FILE=`pwd`/.github/mingw-w64-x86_64.cmake -D RYML_DEV=ON -D RYML_BUILD_BENCHMARKS=OFF && \
cmake --build $bd -j --target $tgt && \
env WINEPATH="/usr/lib/gcc/x86_64-w64-mingw32/7.3-win32;/usr/x86_64-w64-mingw32/lib" wine ./$bd/bin/$tgt.exe --gtest_filter=*486* )
```
with wine in ubuntu22.04 (gcc 10)
```
( set -xe ; \
cd /rapidyaml/ ; \
bt=Release ; \
bd=build/docker-mingw-$bt ; \
tgt=ryml-test-scalar_dquoted ; \
export C4_EXTERN_DIR=`pwd`/build/extern ; \
mkdir -p $C4_EXTERN_DIR ; \
cmake -B $bd -D
CMAKE_TOOLCHAIN_FILE=`pwd`/.github/mingw-w64-x86_64.cmake -D RYML_DEV=ON -D RYML_BUILD_BENCHMARKS=OFF && \
cmake --build $bd -j --target $tgt && \
env WINEPATH="/usr/lib/gcc/x86_64-w64-mingw32/10-win32;/usr/x86_64-w64-mingw32/lib" wine ./$bd/bin/$tgt.exe --gtest_filter=*486* )
```
2025-01-20 18:33:54 +00:00

17 lines
604 B
CMake

set(CMAKE_SYSTEM_NAME Windows)
set(TOOLCHAIN_PREFIX x86_64-w64-mingw32)
# cross compilers to use for C, C++ and Fortran
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
set(CMAKE_Fortran_COMPILER ${TOOLCHAIN_PREFIX}-gfortran)
set(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres)
# target environment on the build host system
set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX})
# modify default behavior of FIND_XXX() commands
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)