mirror of
https://github.com/reactos/reactos.git
synced 2024-10-02 07:26:47 +00:00
[CMAKE]
- Initial support of the arm toolchain/build. svn path=/branches/cmake-bringup/; revision=50300
This commit is contained in:
parent
6c0c23cb53
commit
166360a829
|
@ -11,17 +11,18 @@ if(ARCH MATCHES i386)
|
|||
include(config.cmake)
|
||||
elseif(ARCH MATCHES amd64)
|
||||
include(config-amd64.cmake)
|
||||
elseif(ARCH MATCHES arm)
|
||||
include(config-arm.cmake)
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_CROSSCOMPILING)
|
||||
|
||||
add_definitions(-DTARGET_${ARCH})
|
||||
|
||||
if(ARCH MATCHES i386)
|
||||
add_definitions(-DTARGET_i386)
|
||||
if(MSVC)
|
||||
add_definitions(-Dinline=__inline)
|
||||
endif()
|
||||
elseif(ARCH MATCHES amd64)
|
||||
add_definitions(-DTARGET_amd64)
|
||||
endif()
|
||||
|
||||
include_directories(
|
||||
|
@ -117,6 +118,9 @@ if(CMAKE_CROSSCOMPILING)
|
|||
add_definitions(-D_M_IX86 -D_X86_ -D__i386__)
|
||||
elseif(ARCH MATCHES amd64)
|
||||
add_definitions(-D_M_AMD64 -D_AMD64_ -D_M_AXP64 -D__x86_64__ -D_WIN64)
|
||||
elseif(ARCH MATCHES arm)
|
||||
# _M_ARM is already defined by toolchain
|
||||
add_definitions(-D_ARM_ -D__arm__)
|
||||
endif()
|
||||
|
||||
# Other
|
||||
|
@ -124,6 +128,8 @@ if(CMAKE_CROSSCOMPILING)
|
|||
add_definitions(-DUSE_COMPILER_EXCEPTIONS -D_USE_32BIT_TIME_T)
|
||||
elseif(ARCH MATCHES amd64)
|
||||
add_definitions(-DUSE_COMPILER_EXCEPTIONS -DNO_UNDERSCORE_PREFIX)
|
||||
elseif(ARCH MATCHES arm)
|
||||
add_definitions(-DUSE_COMPILER_EXCEPTIONS)
|
||||
endif()
|
||||
|
||||
include_directories(
|
||||
|
@ -140,6 +146,10 @@ if(CMAKE_CROSSCOMPILING)
|
|||
include/reactos
|
||||
include/reactos/libs)
|
||||
|
||||
if(ARCH MATCHES arm)
|
||||
include_directories(${REACTOS_SOURCE_DIR}/include/reactos/arm)
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
include_directories(include/crt/msc)
|
||||
else()
|
||||
|
|
46
config-arm.cmake
Normal file
46
config-arm.cmake
Normal file
|
@ -0,0 +1,46 @@
|
|||
|
||||
set(SARCH "omap3-zoom2" CACHE STRING
|
||||
"Sub-architecture (board) to build for. Specify one of:
|
||||
kurobox versatile omap3-zoom2 omap3-beagle")
|
||||
|
||||
set(OARCH "armv7-a" CACHE STRING
|
||||
"Generate instructions for this CPU type. Specify one of:
|
||||
armv5te armv7-a")
|
||||
|
||||
set (OPTIMIZE "1" CACHE STRING
|
||||
"What level of optimisation to use.
|
||||
0 = off
|
||||
1 = Default option, optimize for size (-Os) with some additional options
|
||||
2 = -Os
|
||||
3 = -O1
|
||||
4 = -O2
|
||||
5 = -O3")
|
||||
|
||||
set(DBG TRUE CACHE BOOL
|
||||
"Whether to compile for debugging.")
|
||||
|
||||
set(KDBG FALSE CACHE BOOL
|
||||
"Whether to compile in the integrated kernel debugger.")
|
||||
|
||||
set(GDB FALSE CACHE BOOL
|
||||
"Whether to compile for debugging with GDB.
|
||||
If you don't use GDB, don't enable this.")
|
||||
|
||||
set(_WINKD_ TRUE CACHE BOOL
|
||||
"Whether to compile with the KD protocol.")
|
||||
|
||||
set(_ELF_ FALSE CACHE BOOL
|
||||
"Whether to compile support for ELF files.
|
||||
Do not enable unless you know what you're doing.")
|
||||
|
||||
set(NSWPAT FALSE CACHE BOOL
|
||||
"Whether to compile apps/libs with features covered software patents or not.
|
||||
If you live in a country where software patents are valid/apply, don't
|
||||
enable this (except they/you purchased a license from the patent owner).
|
||||
This settings is disabled (0) by default.")
|
||||
|
||||
set(BUILD_MP TRUE CACHE BOOL
|
||||
"Whether to compile the multi processor versions for ntoskrnl and hal.")
|
||||
|
||||
set(NEWSPRINTF FALSE CACHE BOOL
|
||||
"Whether to compile the new sprintf.")
|
|
@ -26,7 +26,7 @@ add_definitions(-gdwarf-2 -g2 -femit-struct-debug-detailed=none -feliminate-unus
|
|||
# Tuning
|
||||
if(ARCH MATCHES i386)
|
||||
add_definitions(-march=${OARCH} -mtune=${TUNE})
|
||||
elseif(ARCH MATCHES amd64)
|
||||
else()
|
||||
add_definitions(-march=${OARCH})
|
||||
endif()
|
||||
|
||||
|
|
|
@ -31,7 +31,6 @@ list(APPEND CRT_SOURCE
|
|||
except/cppexcept.c
|
||||
except/except.c
|
||||
except/matherr.c
|
||||
except/${ARCH}/seh.s
|
||||
except/xcptfil.c
|
||||
float/chgsign.c
|
||||
float/copysign.c
|
||||
|
@ -141,7 +140,6 @@ list(APPEND CRT_SOURCE
|
|||
search/bsearch.c
|
||||
search/lfind.c
|
||||
search/lsearch.c
|
||||
setjmp/${ARCH}/setjmp.s
|
||||
signal/signal.c
|
||||
signal/xcptinfo.c
|
||||
stdio/access.c
|
||||
|
@ -281,6 +279,11 @@ list(APPEND CRT_SOURCE
|
|||
wine/heap.c
|
||||
wine/undname.c)
|
||||
|
||||
if(NOT ARCH MATCHES arm)
|
||||
list(APPEND CRT_SOURCE
|
||||
except/${ARCH}/seh.s)
|
||||
endif()
|
||||
|
||||
if(ARCH MATCHES i386)
|
||||
list(APPEND CRT_SOURCE
|
||||
except/i386/chkstk_asm.s
|
||||
|
@ -290,7 +293,8 @@ list(APPEND CRT_SOURCE
|
|||
float/i386/cntrlfp.c
|
||||
float/i386/fpreset.c
|
||||
float/i386/logb.c
|
||||
float/i386/statfp.c)
|
||||
float/i386/statfp.c
|
||||
setjmp/i386/setjmp.s)
|
||||
elseif(ARCH MATCHES amd64)
|
||||
list(APPEND CRT_SOURCE
|
||||
except/amd64/chkstk_asm.s
|
||||
|
@ -298,8 +302,9 @@ list(APPEND CRT_SOURCE
|
|||
float/i386/cntrlfp.c
|
||||
float/i386/fpreset.c
|
||||
float/i386/logb.c
|
||||
float/i386/statfp.c)
|
||||
endif(ARCH MATCHES i386)
|
||||
float/i386/statfp.c
|
||||
setjmp/amd64/setjmp.s)
|
||||
endif()
|
||||
|
||||
if(ARCH MATCHES i386)
|
||||
list(APPEND CRT_SOURCE
|
||||
|
@ -384,7 +389,7 @@ list(APPEND CRT_SOURCE
|
|||
string/wcsncpy.c
|
||||
string/wcsnlen.c
|
||||
string/wcsrchr.c)
|
||||
endif(ARCH MATCHES i386)
|
||||
endif()
|
||||
|
||||
if(ARCH MATCHES amd64)
|
||||
list(APPEND CRT_SOURCE
|
||||
|
@ -408,7 +413,7 @@ list(APPEND CRT_SOURCE
|
|||
math/amd64/sqrt.S
|
||||
math/amd64/sqrtf.S
|
||||
math/amd64/tan.S)
|
||||
endif(ARCH MATCHES amd64)
|
||||
endif()
|
||||
|
||||
add_library(crt ${CMAKE_CURRENT_BINARY_DIR}/crt_precomp.h.gch ${CRT_SOURCE})
|
||||
|
||||
|
@ -417,8 +422,6 @@ add_pch(crt ${CMAKE_CURRENT_SOURCE_DIR}/precomp.h ${CRT_SOURCE})
|
|||
add_dependencies(crt psdk buildno_header asm)
|
||||
|
||||
list(APPEND LIBCNTPR_SOURCE
|
||||
except/${ARCH}/chkstk_asm.s
|
||||
except/${ARCH}/seh.s
|
||||
math/abs.c
|
||||
math/div.c
|
||||
math/labs.c
|
||||
|
@ -428,7 +431,6 @@ list(APPEND LIBCNTPR_SOURCE
|
|||
mem/memicmp.c
|
||||
search/bsearch.c
|
||||
search/lfind.c
|
||||
setjmp/${ARCH}/setjmp.s
|
||||
stdlib/qsort.c
|
||||
string/ctype.c
|
||||
string/scanf.c
|
||||
|
@ -468,6 +470,13 @@ list(APPEND LIBCNTPR_SOURCE
|
|||
wstring/wcsspn.c
|
||||
wstring/wcsstr.c)
|
||||
|
||||
if(NOT ARCH MATCHES arm)
|
||||
list(APPEND LIBCNTPR_SOURCE
|
||||
except/${ARCH}/chkstk_asm.s
|
||||
except/${ARCH}/seh.s
|
||||
setjmp/${ARCH}/setjmp.s)
|
||||
endif()
|
||||
|
||||
if(ARCH MATCHES i386)
|
||||
list(APPEND LIBCNTPR_SOURCE
|
||||
math/i386/alldiv_asm.s
|
||||
|
@ -512,7 +521,7 @@ list(APPEND LIBCNTPR_SOURCE
|
|||
math/amd64/pow.S
|
||||
math/amd64/sqrt.S
|
||||
math/amd64/tan.S)
|
||||
endif(ARCH MATCHES i386)
|
||||
endif()
|
||||
|
||||
if(ARCH MATCHES i386)
|
||||
list(APPEND LIBCNTPR_SOURCE
|
||||
|
@ -565,7 +574,7 @@ list(APPEND LIBCNTPR_SOURCE
|
|||
string/wcsncpy.c
|
||||
string/wcsnlen.c
|
||||
string/wcsrchr.c)
|
||||
endif(ARCH MATCHES i386)
|
||||
endif()
|
||||
|
||||
add_library(libcntpr ${LIBCNTPR_SOURCE})
|
||||
set_property(TARGET libcntpr PROPERTY COMPILE_DEFINITIONS NO_RTL_INLINES _NTSYSTEM_ _NTDLLBUILD_ _LIBCNT_ __CRT__NO_INLINE)
|
||||
|
|
|
@ -14,6 +14,8 @@ if(ARCH MATCHES i386)
|
|||
|
||||
elseif(ARCH MATCHES amd64)
|
||||
set(MINGW_PREFIX "x86_64-w64-mingw32-" CACHE STRING "MinGW Prefix")
|
||||
elseif(ARCH MATCHES arm)
|
||||
set(MINGW_PREFIX "arm-mingw32ce-" CACHE STRING "MinGW Prefix")
|
||||
endif()
|
||||
|
||||
if(ENABLE_CCACHE)
|
||||
|
@ -38,6 +40,8 @@ if(ARCH MATCHES i386)
|
|||
set(CMAKE_IDL_COMPILE_OBJECT "<CMAKE_IDL_COMPILER> <FLAGS> <DEFINES> -m32 --win32 -h -o <OBJECT> <SOURCE>")
|
||||
elseif(ARCH MATCHES amd64)
|
||||
set(CMAKE_IDL_COMPILE_OBJECT "<CMAKE_IDL_COMPILER> <FLAGS> <DEFINES> -m64 --win64 -h -o <OBJECT> <SOURCE>")
|
||||
elseif(ARCH MATCHES arm)
|
||||
set(CMAKE_IDL_COMPILE_OBJECT "<CMAKE_IDL_COMPILER> <FLAGS> <DEFINES> -h -o <OBJECT> <SOURCE>")
|
||||
endif()
|
||||
|
||||
set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -i <SOURCE> <CMAKE_C_LINK_FLAGS> <DEFINES> -I${REACTOS_SOURCE_DIR}/include/psdk -I${REACTOS_BINARY_DIR}/include/psdk -I${REACTOS_SOURCE_DIR}/include/ -I${REACTOS_SOURCE_DIR}/include/reactos -I${REACTOS_BINARY_DIR}/include/reactos -I${REACTOS_SOURCE_DIR}/include/reactos/wine -I${REACTOS_SOURCE_DIR}/include/crt -I${REACTOS_SOURCE_DIR}/include/crt/mingw32 -O coff -o <OBJECT> ")
|
||||
|
|
Loading…
Reference in a new issue