Is it possible to use clang3.6 with cmake to create mingw64 builds?
I tried to modify the toolchain from ubuntu/mingw:
set(CMAKE_SYSTEM_NAME Windows)
set(TOOLCHAIN_PREFIX i686-w64-mingw32)
set(CMAKE_SYSTEM_PROCESSOR i686)
# mingw64 gcc setup
#set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
#set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
#set(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres)
# mingw64 clang setup
set(CMAKE_C_COMPILER clang)
set(CMAKE_CXX_COMPILER clang++)
set(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres)
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}
-target=--target=i686-w64-mingw32" )
SET( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}
-target=--target=i686-w64-mingw32" )
set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX})
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
add_definitions(-D__MINGW64__)
set(CMAKE_LIBRARY_PATH /usr/lib/gcc/i686-w64-mingw32/4.9.1)
But I always get this error:
-- The C compiler identification is Clang 3.6.0
-- The CXX compiler identification is unknown
-- Check for working C compiler: /usr/local/bin/clang
-- Check for working C compiler: /usr/local/bin/clang -- broken
CMake Error at /usr/share/cmake-3.0/Modules/CMakeTestCCompiler.cmake:61
(message):
The C compiler "/usr/local/bin/clang" is not able to compile a simple
test
program.
BTW clang works:
clang --target=i686-w64-mingw32 hello.c
wine ./a.out
Hello World
TIA
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public