Skip to content

Support of mingw cross compilation? #10

@Hideman85

Description

@Hideman85
HastyNoise/build (master)$ cmake .. -DCMAKE_TOOLCHAIN_FILE=../WindowsCompileOnLinux.cmake 
-- The C compiler identification is GNU 8.3.0
-- The CXX compiler identification is GNU 8.3.0
-- Check for working C compiler: /usr/bin/x86_64-w64-mingw32-gcc
-- Check for working C compiler: /usr/bin/x86_64-w64-mingw32-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/x86_64-w64-mingw32-g++
-- Check for working CXX compiler: /usr/bin/x86_64-w64-mingw32-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- HN_SIMD_SSE2: ON
-- HN_SIMD_SSE41: ON
-- HN_SIMD_AVX2: ON
-- HN_SIMD_AVX512: ON
-- Configuring done
-- Generating done
-- Build files have been written to: HastyNoise/build
HastyNoise/build (master)$ make
Scanning dependencies of target hastyNoise
[  9%] Building CXX object CMakeFiles/hastyNoise.dir/HastyNoise/hastyNoise.cpp.obj
HastyNoise/HastyNoise/hastyNoise.cpp: In function ‘size_t HastyNoise::_GetFastestSIMD()’:
HastyNoise/HastyNoise/hastyNoise.cpp:175:40: error: ‘_XCR_XFEATURE_ENABLED_MASK’ was not declared in this scope
         uint64_t xcrFeatureMask=xgetbv(_XCR_XFEATURE_ENABLED_MASK);
                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~
HastyNoise/HastyNoise/hastyNoise.cpp:201:34: error: ‘_XCR_XFEATURE_ENABLED_MASK’ was not declared in this scope
     bool oxAVX512Support=(xgetbv(_XCR_XFEATURE_ENABLED_MASK)&0xe6)==0xe6;
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/hastyNoise.dir/build.make:63: CMakeFiles/hastyNoise.dir/HastyNoise/hastyNoise.cpp.obj] Error 1
make[1]: *** [CMakeFiles/Makefile2:112: CMakeFiles/hastyNoise.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

Toolchain file:

# the name of the target operating system
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_EXE_LINKER_FLAGS -static-libstdc++\ -static-libgcc\ -static)

# Which compilers to use for C and C++
set(CMAKE_C_COMPILER /usr/bin/x86_64-w64-mingw32-gcc)
set(CMAKE_CXX_COMPILER /usr/bin/x86_64-w64-mingw32-g++)
set(CMAKE_RC_COMPILER /usr/bin/x86_64-w64-mingw32-windres)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions