Add the notion of toolschain.

- For now, only the win32 is here.
- There no more nativeBuilEnv as the buildEnv can launch command without
  using the toolschain.
This commit is contained in:
Matthieu Gautier
2017-02-22 12:42:53 +01:00
parent 77137e0908
commit 00acba9ee9
5 changed files with 165 additions and 96 deletions

View File

@ -2,11 +2,11 @@ SET(CMAKE_SYSTEM_NAME Windows)
SET(CMAKE_SYSTEM_PROCESSOR x86)
# specify the cross compiler
SET(CMAKE_C_COMPILER "{which:{binaries[c]}}")
SET(CMAKE_CXX_COMPILER "{which:{binaries[cpp]}}")
SET(CMAKE_RC_COMPILER {which:{binaries[windres]}})
SET(CMAKE_AR:FILEPATH {which:{binaries[ar]}})
SET(CMAKE_RANLIB:FILEPATH {which:{binaries[ranlib]}})
SET(CMAKE_C_COMPILER "{toolchain.binaries[CC]}")
SET(CMAKE_CXX_COMPILER "{toolchain.binaries[CXX]}")
SET(CMAKE_RC_COMPILER {toolchain.binaries[WINDRES]})
SET(CMAKE_AR:FILEPATH {toolchain.binaries[AR]})
SET(CMAKE_RANLIB:FILEPATH {toolchain.binaries[RANLIB]})
find_program(CCACHE_FOUND ccache)
if(CCACHE_FOUND)
@ -15,7 +15,7 @@ if(CCACHE_FOUND)
endif(CCACHE_FOUND)
# where is the target environment
SET(CMAKE_FIND_ROOT_PATH {root_path})
SET(CMAKE_FIND_ROOT_PATH {toolchain.root_path})
# search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)

View File

@ -1,16 +1,16 @@
[binaries]
pkgconfig = 'pkg-config'
c = '{which:{binaries[c]}}'
ar = '{which:{binaries[ar]}}'
cpp = '{which:{binaries[cpp]}}'
strip = '{which:{binaries[strip]}}'
c = '{toolchain.binaries[CC]}'
ar = '{toolchain.binaries[AR]}'
cpp = '{toolchain.binaries[CXX]}'
strip = '{toolchain.binaries[STRIP]}'
[properties]
c_link_args = ['-lwinmm', '-lws2_32', '-lshlwapi', '-lrpcrt4']
cpp_link_args = ['-lwinmm', '-lws2_32', '-lshlwapi', '-lrpcrt4']
c_link_args = {properties[c_link_args]!r}
cpp_link_args = {properties[cpp_link_args]!r}
[host_machine]
cpu_family = 'x86'
cpu = 'i586'
system = 'windows'
endian = 'little'
cpu_family = '{host_machine[cpu_family]}'
cpu = '{host_machine[cpu]}'
system = '{host_machine[system]}'
endian = '{host_machine[endian]}'