* Prefer STREQUAL over MATCHES since we're comparing with strings here. Brought to you by Hermès Bélusca.
See issue #7306 for more details.

svn path=/trunk/; revision=57181
This commit is contained in:
Amine Khaldi 2012-08-27 18:58:27 +00:00
parent b60aa289ab
commit 2a0e108e5b
42 changed files with 150 additions and 140 deletions

View file

@ -29,14 +29,19 @@ set(CMAKE_COLOR_MAKEFILE OFF)
if(NOT ARCH) if(NOT ARCH)
set(ARCH i386) set(ARCH i386)
endif() endif()
# Now the ARCH variable will be in lowercase.
# It is needed because STREQUAL comparison
# is case-sensitive.
# See http://cmake.3232098.n2.nabble.com/Case-insensitive-string-compare-td7580269.html
# for more information.
string(TOLOWER ${ARCH} ARCH) string(TOLOWER ${ARCH} ARCH)
# Compile options # Compile options
if(ARCH MATCHES i386) if(ARCH STREQUAL "i386")
include(cmake/config.cmake) include(cmake/config.cmake)
elseif(ARCH MATCHES amd64) elseif(ARCH STREQUAL "amd64")
include(cmake/config-amd64.cmake) include(cmake/config-amd64.cmake)
elseif(ARCH MATCHES arm) elseif(ARCH STREQUAL "arm")
include(cmake/config-arm.cmake) include(cmake/config-arm.cmake)
endif() endif()
@ -50,7 +55,7 @@ if(NOT CMAKE_CROSSCOMPILING)
add_definitions(-DTARGET_${ARCH}) add_definitions(-DTARGET_${ARCH})
if(MSVC) if(MSVC)
if(ARCH MATCHES i386) if(ARCH STREQUAL "i386")
add_definitions(/D_X86_ /DWIN32 /D_WINDOWS) add_definitions(/D_X86_ /DWIN32 /D_WINDOWS)
endif() endif()
add_definitions(/Dinline=__inline) add_definitions(/Dinline=__inline)
@ -128,21 +133,21 @@ else()
-D_SETUPAPI_VER=0x502) -D_SETUPAPI_VER=0x502)
# Arch Options # Arch Options
if(ARCH MATCHES i386) if(ARCH STREQUAL "i386")
add_definitions(-D_M_IX86 -D_X86_ -D__i386__) add_definitions(-D_M_IX86 -D_X86_ -D__i386__)
elseif(ARCH MATCHES amd64) elseif(ARCH STREQUAL "amd64")
add_definitions(-D_M_AMD64 -D_AMD64_ -D__x86_64__ -D_WIN64) add_definitions(-D_M_AMD64 -D_AMD64_ -D__x86_64__ -D_WIN64)
elseif(ARCH MATCHES arm) elseif(ARCH STREQUAL "arm")
# _M_ARM is already defined by toolchain # _M_ARM is already defined by toolchain
add_definitions(-D_ARM_ -D__arm__) add_definitions(-D_ARM_ -D__arm__)
endif() endif()
# Other # Other
if(ARCH MATCHES i386) if(ARCH STREQUAL "i386")
add_definitions(-DUSE_COMPILER_EXCEPTIONS -D_USE_32BIT_TIME_T) add_definitions(-DUSE_COMPILER_EXCEPTIONS -D_USE_32BIT_TIME_T)
elseif(ARCH MATCHES amd64) elseif(ARCH STREQUAL "amd64")
add_definitions(-DUSE_COMPILER_EXCEPTIONS -DNO_UNDERSCORE_PREFIX) add_definitions(-DUSE_COMPILER_EXCEPTIONS -DNO_UNDERSCORE_PREFIX)
elseif(ARCH MATCHES arm) elseif(ARCH STREQUAL "arm")
add_definitions(-DUSE_COMPILER_EXCEPTIONS) add_definitions(-DUSE_COMPILER_EXCEPTIONS)
endif() endif()
@ -203,7 +208,7 @@ else()
endif() endif()
if(ARCH MATCHES arm) if(ARCH STREQUAL "arm")
include_directories(${REACTOS_SOURCE_DIR}/include/reactos/arm) include_directories(${REACTOS_SOURCE_DIR}/include/reactos/arm)
endif() endif()

View file

@ -1,5 +1,5 @@
if(ARCH MATCHES i386 OR ARCH MATCHES amd64) if(ARCH STREQUAL "i386" OR ARCH STREQUAL "amd64")
CreateBootSectorTarget(dosmbr ${CMAKE_CURRENT_SOURCE_DIR}/dosmbr.S ${CMAKE_CURRENT_BINARY_DIR}/dosmbr.bin 7c00) CreateBootSectorTarget(dosmbr ${CMAKE_CURRENT_SOURCE_DIR}/dosmbr.S ${CMAKE_CURRENT_BINARY_DIR}/dosmbr.bin 7c00)
CreateBootSectorTarget(ext2 ${CMAKE_CURRENT_SOURCE_DIR}/ext2.S ${CMAKE_CURRENT_BINARY_DIR}/ext2.bin 0) CreateBootSectorTarget(ext2 ${CMAKE_CURRENT_SOURCE_DIR}/ext2.S ${CMAKE_CURRENT_BINARY_DIR}/ext2.bin 0)

View file

@ -6,12 +6,12 @@ endif()
spec2def(freeldr.sys freeldr.spec) spec2def(freeldr.sys freeldr.spec)
if(ARCH MATCHES i386) if(ARCH STREQUAL "i386")
CreateBootSectorTarget(frldr16 CreateBootSectorTarget(frldr16
${CMAKE_CURRENT_SOURCE_DIR}/arch/realmode/i386.S ${CMAKE_CURRENT_SOURCE_DIR}/arch/realmode/i386.S
${CMAKE_CURRENT_BINARY_DIR}/frldr16.bin ${CMAKE_CURRENT_BINARY_DIR}/frldr16.bin
F800) F800)
elseif(ARCH MATCHES amd64) elseif(ARCH STREQUAL "amd64")
CreateBootSectorTarget(frldr16 CreateBootSectorTarget(frldr16
${CMAKE_CURRENT_SOURCE_DIR}/arch/realmode/amd64.S ${CMAKE_CURRENT_SOURCE_DIR}/arch/realmode/amd64.S
${CMAKE_CURRENT_BINARY_DIR}/frldr16.bin ${CMAKE_CURRENT_BINARY_DIR}/frldr16.bin
@ -26,10 +26,8 @@ include_directories(${REACTOS_SOURCE_DIR}/include/reactos/elf)
add_definitions(-D_NTHAL_ -D_BLDR_ -D_NTSYSTEM_) add_definitions(-D_NTHAL_ -D_BLDR_ -D_NTSYSTEM_)
if(ARCH MATCHES arm) if((ARCH STREQUAL "arm") AND (SARCH STREQUAL "omap-zoom2"))
if(SARCH MATCHES omap-zoom2) add_definitions(-D_ZOOM2_)
add_definitions(-D_ZOOM2_)
endif()
endif() endif()
list(APPEND FREELDR_COMMON_SOURCE list(APPEND FREELDR_COMMON_SOURCE
@ -80,7 +78,7 @@ list(APPEND FREELDR_COMMON_SOURCE
windows/wlmemory.c windows/wlmemory.c
windows/wlregistry.c) windows/wlregistry.c)
if(ARCH MATCHES i386) if(ARCH STREQUAL "i386")
list(APPEND FREELDR_COMMON_SOURCE list(APPEND FREELDR_COMMON_SOURCE
arch/i386/archmach.c arch/i386/archmach.c
arch/i386/custom.c arch/i386/custom.c
@ -125,7 +123,7 @@ if(ARCH MATCHES i386)
list(APPEND FREELDR_COMMON_SOURCE list(APPEND FREELDR_COMMON_SOURCE
arch/i386/drvmap.S) arch/i386/drvmap.S)
endif() endif()
elseif(ARCH MATCHES amd64) elseif(ARCH STREQUAL "amd64")
list(APPEND FREELDR_COMMON_SOURCE list(APPEND FREELDR_COMMON_SOURCE
arch/amd64/entry.S arch/amd64/entry.S
arch/amd64/int386.S arch/amd64/int386.S
@ -157,7 +155,7 @@ else()
add_dependencies(freeldr_common bugcodes) add_dependencies(freeldr_common bugcodes)
endif() endif()
if(ARCH MATCHES i386 AND NOT MSVC) if(ARCH STREQUAL "i386" AND NOT MSVC)
list(APPEND FREELDR_BASE_SOURCE arch/i386/multiboot.S) list(APPEND FREELDR_BASE_SOURCE arch/i386/multiboot.S)
endif() endif()
@ -197,7 +195,7 @@ set_image_base(freeldr_pe_dbg 0x10000)
set_subsystem(freeldr_pe_dbg native) set_subsystem(freeldr_pe_dbg native)
set_entrypoint(freeldr_pe_dbg RealEntryPoint) set_entrypoint(freeldr_pe_dbg RealEntryPoint)
if(ARCH MATCHES i386) if(ARCH STREQUAL "i386")
target_link_libraries(freeldr_pe mini_hal) target_link_libraries(freeldr_pe mini_hal)
target_link_libraries(freeldr_pe_dbg mini_hal) target_link_libraries(freeldr_pe_dbg mini_hal)
endif() endif()
@ -229,7 +227,7 @@ add_cd_file(TARGET freeldr FILE ${CMAKE_CURRENT_BINARY_DIR}/freeldr.sys DESTINAT
list(APPEND SETUPLDR_SOURCE list(APPEND SETUPLDR_SOURCE
inffile/inffile.c) inffile/inffile.c)
if(ARCH MATCHES i386 OR ARCH MATCHES amd64) if(ARCH STREQUAL "i386" OR ARCH STREQUAL "amd64")
list(APPEND SETUPLDR_SOURCE windows/setupldr.c) list(APPEND SETUPLDR_SOURCE windows/setupldr.c)
endif() endif()
@ -262,7 +260,7 @@ set_image_base(setupldr_pe_dbg 0x10000)
set_subsystem(setupldr_pe_dbg native) set_subsystem(setupldr_pe_dbg native)
set_entrypoint(setupldr_pe_dbg RealEntryPoint) set_entrypoint(setupldr_pe_dbg RealEntryPoint)
if(ARCH MATCHES i386) if(ARCH STREQUAL "i386")
target_link_libraries(setupldr_pe mini_hal) target_link_libraries(setupldr_pe mini_hal)
target_link_libraries(setupldr_pe_dbg mini_hal) target_link_libraries(setupldr_pe_dbg mini_hal)
endif() endif()

View file

@ -247,7 +247,7 @@ if(NOT MSVC_IDE)
endfunction() endfunction()
endif() endif()
if(CMAKE_HOST_SYSTEM_NAME MATCHES Windows) if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
macro(to_win_path _cmake_path _native_path) macro(to_win_path _cmake_path _native_path)
string(REPLACE "/" "\\" ${_native_path} "${_cmake_path}") string(REPLACE "/" "\\" ${_native_path} "${_cmake_path}")
endmacro() endmacro()

View file

@ -28,7 +28,7 @@ set(GDB FALSE CACHE BOOL
"Whether to compile for debugging with GDB. "Whether to compile for debugging with GDB.
If you don't use GDB, don't enable this.") If you don't use GDB, don't enable this.")
if(${CMAKE_BUILD_TYPE} MATCHES Release) if(CMAKE_BUILD_TYPE STREQUAL "Release")
set(DBG FALSE CACHE BOOL set(DBG FALSE CACHE BOOL
"Whether to compile for debugging.") "Whether to compile for debugging.")
else() else()
@ -39,7 +39,7 @@ endif()
if(MSVC) if(MSVC)
set(KDBG FALSE CACHE BOOL set(KDBG FALSE CACHE BOOL
"Whether to compile in the integrated kernel debugger.") "Whether to compile in the integrated kernel debugger.")
if(${CMAKE_BUILD_TYPE} MATCHES Release) if(CMAKE_BUILD_TYPE STREQUAL "Release")
set(_WINKD_ FALSE CACHE BOOL "Whether to compile with the KD protocol.") set(_WINKD_ FALSE CACHE BOOL "Whether to compile with the KD protocol.")
else() else()
set(_WINKD_ TRUE CACHE BOOL "Whether to compile with the KD protocol.") set(_WINKD_ TRUE CACHE BOOL "Whether to compile with the KD protocol.")

View file

@ -16,7 +16,7 @@ add_compile_flags("-pipe -fms-extensions")
#file(TO_NATIVE_PATH ${REACTOS_SOURCE_DIR} REACTOS_SOURCE_DIR_NATIVE) #file(TO_NATIVE_PATH ${REACTOS_SOURCE_DIR} REACTOS_SOURCE_DIR_NATIVE)
#workaround #workaround
set(REACTOS_SOURCE_DIR_NATIVE ${REACTOS_SOURCE_DIR}) set(REACTOS_SOURCE_DIR_NATIVE ${REACTOS_SOURCE_DIR})
if(CMAKE_HOST_SYSTEM_NAME MATCHES Windows) if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
string(REPLACE "/" "\\" REACTOS_SOURCE_DIR_NATIVE ${REACTOS_SOURCE_DIR}) string(REPLACE "/" "\\" REACTOS_SOURCE_DIR_NATIVE ${REACTOS_SOURCE_DIR})
endif() endif()
add_compile_flags("-fdebug-prefix-map=\"${REACTOS_SOURCE_DIR_NATIVE}\"=ReactOS") add_compile_flags("-fdebug-prefix-map=\"${REACTOS_SOURCE_DIR_NATIVE}\"=ReactOS")
@ -37,7 +37,7 @@ if(DEFINED CMAKE_SHARED_LIBRARY_ASM_FLAGS)
endif() endif()
# Tuning # Tuning
if(ARCH MATCHES i386) if(ARCH STREQUAL "i386")
add_compile_flags("-march=${OARCH} -mtune=${TUNE}") add_compile_flags("-march=${OARCH} -mtune=${TUNE}")
else() else()
add_compile_flags("-march=${OARCH}") add_compile_flags("-march=${OARCH}")
@ -54,9 +54,9 @@ elseif(GCC_VERSION VERSION_EQUAL 4.7 OR GCC_VERSION VERSION_GREATER 4.7)
add_compile_flags("-Wno-error=unused-but-set-variable -Wno-error=maybe-uninitialized -Wno-error=delete-non-virtual-dtor -Wno-error=narrowing") add_compile_flags("-Wno-error=unused-but-set-variable -Wno-error=maybe-uninitialized -Wno-error=delete-non-virtual-dtor -Wno-error=narrowing")
endif() endif()
if(ARCH MATCHES amd64) if(ARCH STREQUAL "amd64")
add_compile_flags("-Wno-format") add_compile_flags("-Wno-format")
elseif(ARCH MATCHES arm) elseif(ARCH STREQUAL "arm")
add_compile_flags("-Wno-attributes") add_compile_flags("-Wno-attributes")
endif() endif()
@ -80,26 +80,26 @@ endif()
add_compile_flags("-fno-strict-aliasing") add_compile_flags("-fno-strict-aliasing")
if(ARCH MATCHES i386) if(ARCH STREQUAL "i386")
add_compile_flags("-mpreferred-stack-boundary=3 -fno-set-stack-executable -fno-optimize-sibling-calls -fno-omit-frame-pointer") add_compile_flags("-mpreferred-stack-boundary=3 -fno-set-stack-executable -fno-optimize-sibling-calls -fno-omit-frame-pointer")
if(OPTIMIZE STREQUAL "1") if(OPTIMIZE STREQUAL "1")
add_compile_flags("-ftracer -momit-leaf-frame-pointer") add_compile_flags("-ftracer -momit-leaf-frame-pointer")
endif() endif()
elseif(ARCH MATCHES amd64) elseif(ARCH STREQUAL "amd64")
add_compile_flags("-mpreferred-stack-boundary=4") add_compile_flags("-mpreferred-stack-boundary=4")
if(OPTIMIZE STREQUAL "1") if(OPTIMIZE STREQUAL "1")
add_compile_flags("-ftracer -momit-leaf-frame-pointer") add_compile_flags("-ftracer -momit-leaf-frame-pointer")
endif() endif()
elseif(ARCH MATCHES arm) elseif(ARCH STREQUAL "arm")
if(OPTIMIZE STREQUAL "1") if(OPTIMIZE STREQUAL "1")
add_compile_flags("-ftracer") add_compile_flags("-ftracer")
endif() endif()
endif() endif()
# Other # Other
if(ARCH MATCHES amd64) if(ARCH STREQUAL "amd64")
add_definitions(-U_X86_ -UWIN32) add_definitions(-U_X86_ -UWIN32)
elseif(ARCH MATCHES arm) elseif(ARCH STREQUAL "arm")
add_definitions(-U_UNICODE -UUNICODE) add_definitions(-U_UNICODE -UUNICODE)
add_definitions(-D__MSVCRT__) # DUBIOUS add_definitions(-D__MSVCRT__) # DUBIOUS
endif() endif()
@ -107,7 +107,7 @@ endif()
add_definitions(-D_inline=__inline) add_definitions(-D_inline=__inline)
# alternative arch name # alternative arch name
if(ARCH MATCHES amd64) if(ARCH STREQUAL "amd64")
set(ARCH2 x86_64) set(ARCH2 x86_64)
else() else()
set(ARCH2 ${ARCH}) set(ARCH2 ${ARCH})
@ -117,7 +117,7 @@ if(SEPARATE_DBG)
# PDB style debug puts all dwarf debug info in a separate dbg file # PDB style debug puts all dwarf debug info in a separate dbg file
message(STATUS "Building separate debug symbols") message(STATUS "Building separate debug symbols")
file(MAKE_DIRECTORY ${REACTOS_BINARY_DIR}/symbols) file(MAKE_DIRECTORY ${REACTOS_BINARY_DIR}/symbols)
if(CMAKE_GENERATOR MATCHES "Ninja") if(CMAKE_GENERATOR STREQUAL "Ninja")
set(SYMBOL_FILE <TARGET_PDB>) set(SYMBOL_FILE <TARGET_PDB>)
else() else()
set(SYMBOL_FILE <TARGET>.gdb) set(SYMBOL_FILE <TARGET>.gdb)
@ -177,7 +177,7 @@ set(CMAKE_DEPFILE_FLAGS_RC "--preprocessor \"<CMAKE_C_COMPILER> -E -xc-header -M
function(set_entrypoint MODULE ENTRYPOINT) function(set_entrypoint MODULE ENTRYPOINT)
if(${ENTRYPOINT} STREQUAL "0") if(${ENTRYPOINT} STREQUAL "0")
add_target_link_flags(${MODULE} "-Wl,-entry,0") add_target_link_flags(${MODULE} "-Wl,-entry,0")
elseif(ARCH MATCHES i386) elseif(ARCH STREQUAL "i386")
set(_entrysymbol _${ENTRYPOINT}) set(_entrysymbol _${ENTRYPOINT})
if(${ARGC} GREATER 2) if(${ARGC} GREATER 2)
set(_entrysymbol ${_entrysymbol}@${ARGV2}) set(_entrysymbol ${_entrysymbol}@${ARGV2})
@ -201,7 +201,7 @@ function(set_module_type_toolchain MODULE TYPE)
target_link_libraries(${MODULE} -lstdc++ -lsupc++ -lgcc -lmingwex) target_link_libraries(${MODULE} -lstdc++ -lsupc++ -lgcc -lmingwex)
endif() endif()
if(${TYPE} STREQUAL kernelmodedriver) if(${TYPE} STREQUAL "kernelmodedriver")
add_target_link_flags(${MODULE} "-Wl,--exclude-all-symbols,-file-alignment=0x1000,-section-alignment=0x1000") add_target_link_flags(${MODULE} "-Wl,--exclude-all-symbols,-file-alignment=0x1000,-section-alignment=0x1000")
endif() endif()
endfunction() endfunction()
@ -216,7 +216,7 @@ function(add_delay_importlibs MODULE)
target_link_libraries(${MODULE} delayimp) target_link_libraries(${MODULE} delayimp)
endfunction() endfunction()
if(NOT ARCH MATCHES i386) if(NOT ARCH STREQUAL "i386")
set(DECO_OPTION "-@") set(DECO_OPTION "-@")
endif() endif()

View file

@ -1,8 +1,8 @@
#idl files support #idl files support
if(ARCH MATCHES i386) if(ARCH STREQUAL "i386")
set(IDL_FLAGS /nologo /win32 /no_def_idir) set(IDL_FLAGS /nologo /win32 /no_def_idir)
elseif(ARCH MATCHES amd64) elseif(ARCH STREQUAL "amd64")
set(IDL_FLAGS /nologo /amd64 /no_def_idir) set(IDL_FLAGS /nologo /amd64 /no_def_idir)
else() else()
set(IDL_FLAGS /nologo /no_def_idir) set(IDL_FLAGS /nologo /no_def_idir)
@ -55,11 +55,11 @@ function(add_rpc_files _type)
get_includes(_includes) get_includes(_includes)
get_defines(_defines) get_defines(_defines)
# Is it a client or server module? # Is it a client or server module?
if(_type STREQUAL server) if(_type STREQUAL "server")
set(_server_client /sstub) set(_server_client /sstub)
set(_suffix _s) set(_suffix _s)
set(_prevent_second_type /client none) set(_prevent_second_type /client none)
elseif(_type STREQUAL client) elseif(_type STREQUAL "client")
set(_server_client /cstub) set(_server_client /cstub)
set(_suffix _c) set(_suffix _c)
set(_prevent_second_type /server none) set(_prevent_second_type /server none)

View file

@ -1,5 +1,6 @@
if(${CMAKE_BUILD_TYPE} MATCHES Debug) #if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
# no optimization # no optimization
elseif(OPTIMIZE STREQUAL "1") elseif(OPTIMIZE STREQUAL "1")
add_definitions(/O1) add_definitions(/O1)
@ -13,7 +14,7 @@ elseif(OPTIMIZE STREQUAL "5")
add_definitions(/GF /Gy /Ob2 /Os /Ox /GS-) add_definitions(/GF /Gy /Ob2 /Os /Ox /GS-)
endif() endif()
if(ARCH MATCHES i386) if(ARCH STREQUAL "i386")
add_definitions(/DWIN32 /D_WINDOWS) add_definitions(/DWIN32 /D_WINDOWS)
endif() endif()
@ -23,7 +24,7 @@ add_compile_flags("/X /GR- /GS- /Zl /W3")
# HACK: for VS 11+ we need to explicitly disable SSE, which is off by # HACK: for VS 11+ we need to explicitly disable SSE, which is off by
# default for older compilers. See bug #7174 # default for older compilers. See bug #7174
if (MSVC_VERSION GREATER 1699 AND ARCH MATCHES i386) if (MSVC_VERSION GREATER 1699 AND ARCH STREQUAL "i386")
add_compile_flags("/arch:IA32") add_compile_flags("/arch:IA32")
endif () endif ()
@ -31,12 +32,14 @@ endif ()
add_compile_flags("/we4700") add_compile_flags("/we4700")
# Debugging # Debugging
if(${CMAKE_BUILD_TYPE} MATCHES Debug) #if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
if(NOT (_PREFAST_ OR _VS_ANALYZE_)) if(NOT (_PREFAST_ OR _VS_ANALYZE_))
add_compile_flags("/Zi") add_compile_flags("/Zi")
endif() endif()
add_compile_flags("/Ob0 /Od") add_compile_flags("/Ob0 /Od")
elseif(${CMAKE_BUILD_TYPE} MATCHES Release) #elseif(${CMAKE_BUILD_TYPE} STREQUAL "Release")
elseif(CMAKE_BUILD_TYPE STREQUAL "Release")
add_compile_flags("/Ob2 /D NDEBUG") add_compile_flags("/Ob2 /D NDEBUG")
endif() endif()
@ -87,7 +90,7 @@ endmacro()
function(set_entrypoint _module _entrypoint) function(set_entrypoint _module _entrypoint)
if(${_entrypoint} STREQUAL "0") if(${_entrypoint} STREQUAL "0")
add_target_link_flags(${_module} "/NOENTRY") add_target_link_flags(${_module} "/NOENTRY")
elseif(ARCH MATCHES i386) elseif(ARCH STREQUAL "i386")
set(_entrysymbol ${_entrypoint}) set(_entrysymbol ${_entrypoint})
if(${ARGC} GREATER 2) if(${ARGC} GREATER 2)
set(_entrysymbol ${_entrysymbol}@${ARGV2}) set(_entrysymbol ${_entrysymbol}@${ARGV2})
@ -107,9 +110,9 @@ function(set_image_base MODULE IMAGE_BASE)
endfunction() endfunction()
function(set_module_type_toolchain MODULE TYPE) function(set_module_type_toolchain MODULE TYPE)
if((${TYPE} STREQUAL win32dll) OR (${TYPE} STREQUAL win32ocx) OR (${TYPE} STREQUAL cpl)) if((${TYPE} STREQUAL "win32dll") OR (${TYPE} STREQUAL "win32ocx") OR (${TYPE} STREQUAL "cpl"))
add_target_link_flags(${MODULE} "/DLL") add_target_link_flags(${MODULE} "/DLL")
elseif(${TYPE} STREQUAL kernelmodedriver) elseif(${TYPE} STREQUAL "kernelmodedriver")
add_target_link_flags(${MODULE} "/DRIVER") add_target_link_flags(${MODULE} "/DRIVER")
endif() endif()
endfunction() endfunction()
@ -166,7 +169,7 @@ function(generate_import_lib _libname _dllname _spec_file)
set_target_properties(${_libname} PROPERTIES STATIC_LIBRARY_FLAGS "/DEF:${_def_file}") set_target_properties(${_libname} PROPERTIES STATIC_LIBRARY_FLAGS "/DEF:${_def_file}")
endfunction() endfunction()
if(${ARCH} MATCHES amd64) if(ARCH STREQUAL "amd64")
add_definitions(/D__x86_64) add_definitions(/D__x86_64)
set(SPEC2DEF_ARCH x86_64) set(SPEC2DEF_ARCH x86_64)
else() else()
@ -211,7 +214,7 @@ set(PSEH_LIB "pseh")
# Use a full path for the x86 version of ml when using x64 VS. # Use a full path for the x86 version of ml when using x64 VS.
# It's not a problem when using the DDK/WDK because, in x64 mode, # It's not a problem when using the DDK/WDK because, in x64 mode,
# both the x86 and x64 versions of ml are available. # both the x86 and x64 versions of ml are available.
if((ARCH MATCHES amd64) AND (DEFINED ENV{VCINSTALLDIR})) if((ARCH STREQUAL "amd64") AND (DEFINED ENV{VCINSTALLDIR}))
set(CMAKE_ASM16_COMPILER $ENV{VCINSTALLDIR}/bin/ml.exe) set(CMAKE_ASM16_COMPILER $ENV{VCINSTALLDIR}/bin/ml.exe)
else() else()
set(CMAKE_ASM16_COMPILER ml.exe) set(CMAKE_ASM16_COMPILER ml.exe)

View file

@ -1,8 +1,8 @@
#idl files support #idl files support
if(ARCH MATCHES i386) if(ARCH STREQUAL "i386")
set(IDL_FLAGS -m32 --win32) set(IDL_FLAGS -m32 --win32)
elseif(ARCH MATCHES amd64) elseif(ARCH STREQUAL "amd64")
set(IDL_FLAGS -m64 --win64) set(IDL_FLAGS -m64 --win64)
else() else()
set(IDL_FLAGS "") set(IDL_FLAGS "")
@ -60,10 +60,10 @@ function(add_rpc_files __type)
get_includes(INCLUDES) get_includes(INCLUDES)
get_defines(DEFINES) get_defines(DEFINES)
# Is it a client or server module? # Is it a client or server module?
if(__type STREQUAL server) if(__type STREQUAL "server")
set(__server_client -Oif -s -o) set(__server_client -Oif -s -o)
set(__suffix _s) set(__suffix _s)
elseif(__type STREQUAL client) elseif(__type STREQUAL "client")
set(__server_client -Oif -c -o) set(__server_client -Oif -c -o)
set(__suffix _c) set(__suffix _c)
else() else()

View file

@ -25,15 +25,15 @@ list(APPEND SOURCE
def/ntdll.rc def/ntdll.rc
${CMAKE_CURRENT_BINARY_DIR}/ntdll.def) ${CMAKE_CURRENT_BINARY_DIR}/ntdll.def)
if(ARCH MATCHES i386) if(ARCH STREQUAL "i386")
list(APPEND SOURCE dispatch/i386/dispatch.S) list(APPEND SOURCE dispatch/i386/dispatch.S)
elseif(ARCH MATCHES amd64) elseif(ARCH STREQUAL "amd64")
list(APPEND SOURCE dispatch/amd64/dispatch.S) list(APPEND SOURCE dispatch/amd64/dispatch.S)
elseif(ARCH MATCHES arm) elseif(ARCH STREQUAL "arm")
list(APPEND SOURCE dispatch/arm/stubs_asm.s) list(APPEND SOURCE dispatch/arm/stubs_asm.s)
else() else()
list(APPEND SOURCE dispatch/dispatch.c) list(APPEND SOURCE dispatch/dispatch.c)
endif(ARCH MATCHES i386) endif(ARCH STREQUAL "i386")
add_library(ntdll SHARED ${SOURCE}) add_library(ntdll SHARED ${SOURCE})

View file

@ -14,7 +14,7 @@ list(APPEND SOURCE
# We don't need a specfile here, as opengl application link against opengl32 # We don't need a specfile here, as opengl application link against opengl32
# and gallium is kind enough to provide good def files for both MSVC/mingw-w64 and mingw32 # and gallium is kind enough to provide good def files for both MSVC/mingw-w64 and mingw32
if(MSVC OR (ARCH MATCHES amd64)) if(MSVC OR (ARCH STREQUAL "amd64"))
list(APPEND SOURCE ../../state_trackers/wgl/opengl32.def) list(APPEND SOURCE ../../state_trackers/wgl/opengl32.def)
else() else()
list(APPEND SOURCE ../../state_trackers/wgl/opengl32.mingw.def) list(APPEND SOURCE ../../state_trackers/wgl/opengl32.mingw.def)

View file

@ -22,7 +22,7 @@ add_subdirectory(comctl32)
add_subdirectory(comdlg32) add_subdirectory(comdlg32)
add_subdirectory(compstui) add_subdirectory(compstui)
add_subdirectory(credui) add_subdirectory(credui)
if(ARCH MATCHES i386) if(ARCH STREQUAL "i386")
add_subdirectory(crtdll) # only built on x86 add_subdirectory(crtdll) # only built on x86
endif() endif()
add_subdirectory(crypt32) add_subdirectory(crypt32)
@ -200,7 +200,7 @@ add_subdirectory(usp10)
add_subdirectory(uxtheme) add_subdirectory(uxtheme)
add_subdirectory(vdmdbg) add_subdirectory(vdmdbg)
add_subdirectory(version) add_subdirectory(version)
if(ARCH MATCHES i386) if(ARCH STREQUAL "i386")
add_subdirectory(wdmaud.drv) add_subdirectory(wdmaud.drv)
endif() endif()
add_subdirectory(windowscodecs) add_subdirectory(windowscodecs)

View file

@ -6,7 +6,7 @@ add_definitions(
-DHAVE_ALLOCA_H -DHAVE_ALLOCA_H
-D_IMAGEHLP_SOURCE_) -D_IMAGEHLP_SOURCE_)
if(ARCH MATCHES amd64) if(ARCH STREQUAL "amd64")
add_definitions(-DUNW_FLAG_NHANDLER=0 -DUNW_FLAG_EHANDLER=1 -DUNW_FLAG_UHANDLER=2 -DUNW_FLAG_CHAININFO=3) add_definitions(-DUNW_FLAG_NHANDLER=0 -DUNW_FLAG_EHANDLER=1 -DUNW_FLAG_UHANDLER=2 -DUNW_FLAG_CHAININFO=3)
endif() endif()

View file

@ -79,15 +79,15 @@ list(APPEND SOURCE
kernel32.rc kernel32.rc
${CMAKE_CURRENT_BINARY_DIR}/kernel32.def) ${CMAKE_CURRENT_BINARY_DIR}/kernel32.def)
if(ARCH MATCHES i386) if(ARCH STREQUAL "i386")
list(APPEND SOURCE list(APPEND SOURCE
client/i386/fiber.S client/i386/fiber.S
client/i386/thread.S) client/i386/thread.S)
elseif(ARCH MATCHES amd64) elseif(ARCH STREQUAL "amd64")
list(APPEND SOURCE list(APPEND SOURCE
client/amd64/fiber.S client/amd64/fiber.S
client/amd64/thread.S) client/amd64/thread.S)
endif(ARCH MATCHES i386) endif(ARCH STREQUAL "i386")
add_library(kernel32 SHARED ${SOURCE}) add_library(kernel32 SHARED ${SOURCE})

View file

@ -28,7 +28,7 @@ list(APPEND SOURCE
${CMAKE_CURRENT_BINARY_DIR}/riched20.def) ${CMAKE_CURRENT_BINARY_DIR}/riched20.def)
if(MSVC) if(MSVC)
if (ARCH MATCHES i386) if(ARCH STREQUAL "i386")
list(APPEND SOURCE msvc-thiscall.c) list(APPEND SOURCE msvc-thiscall.c)
endif() endif()
set_source_files_properties(txthost.c txtsrv.c PROPERTIES COMPILE_FLAGS "/FImsvc.h") set_source_files_properties(txthost.c txtsrv.c PROPERTIES COMPILE_FLAGS "/FImsvc.h")

View file

@ -5,16 +5,16 @@ list(APPEND SOURCE
bootvid.rc bootvid.rc
${CMAKE_CURRENT_BINARY_DIR}/bootvid.def) ${CMAKE_CURRENT_BINARY_DIR}/bootvid.def)
if(ARCH MATCHES i386 OR ARCH MATCHES amd64) if(ARCH STREQUAL "i386" OR ARCH STREQUAL "amd64")
list(APPEND SOURCE list(APPEND SOURCE
i386/bootvid.c i386/bootvid.c
i386/bootdata.c i386/bootdata.c
i386/vga.c) i386/vga.c)
elseif(ARCH MATCHES arm) elseif(ARCH STREQUAL "arm")
list(APPEND SOURCE list(APPEND SOURCE
arm/bootvid.c arm/bootvid.c
arm/bootdata.c) arm/bootdata.c)
endif(ARCH MATCHES i386 OR ARCH MATCHES amd64) endif(ARCH STREQUAL "i386" OR ARCH STREQUAL "amd64")
add_library(bootvid SHARED ${SOURCE}) add_library(bootvid SHARED ${SOURCE})

View file

@ -1,13 +1,13 @@
spec2def(kdcom.dll kdcom.spec ADD_IMPORTLIB) spec2def(kdcom.dll kdcom.spec ADD_IMPORTLIB)
if(ARCH MATCHES i386) if(ARCH STREQUAL "i386")
list(APPEND SOURCE i386/kdbg.c) list(APPEND SOURCE i386/kdbg.c)
elseif(ARCH MATCHES amd64) elseif(ARCH STREQUAL "amd64")
list(APPEND SOURCE i386/kdbg.c) list(APPEND SOURCE i386/kdbg.c)
elseif(ARCH MATCHES arm) elseif(ARCH STREQUAL "arm")
list(APPEND SOURCE arm/kdbg.c) list(APPEND SOURCE arm/kdbg.c)
endif(ARCH MATCHES i386) endif(ARCH STREQUAL "i386")
list(APPEND SOURCE ${CMAKE_CURRENT_BINARY_DIR}/kdcom.def) list(APPEND SOURCE ${CMAKE_CURRENT_BINARY_DIR}/kdcom.def)
add_library(kdcom SHARED ${SOURCE}) add_library(kdcom SHARED ${SOURCE})

View file

@ -3,7 +3,7 @@ include_directories(
include include
acpica/include) acpica/include)
if(ARCH MATCHES amd64) if(ARCH STREQUAL "amd64")
add_definitions(-DWIN64) add_definitions(-DWIN64)
endif() endif()

View file

@ -11,7 +11,7 @@ add_library(cdrom_new SHARED ${SOURCE})
target_link_libraries(cdrom_new libcntpr wdmguid) target_link_libraries(cdrom_new libcntpr wdmguid)
if(ARCH MATCHES i386) if(ARCH STREQUAL "i386")
# FIXME: http://www.cmake.org/Bug/view.php?id=12998 # FIXME: http://www.cmake.org/Bug/view.php?id=12998
if(MSVC) if(MSVC)
#add_target_compile_flags(cdrom_new "/Gz") #add_target_compile_flags(cdrom_new "/Gz")

View file

@ -14,7 +14,7 @@ add_library(disk_new SHARED
disk.rc) disk.rc)
target_link_libraries(disk_new libcntpr wdmguid) target_link_libraries(disk_new libcntpr wdmguid)
if(ARCH MATCHES i386) if(ARCH STREQUAL "i386")
# FIXME: http://www.cmake.org/Bug/view.php?id=12998 # FIXME: http://www.cmake.org/Bug/view.php?id=12998
if(NOT MSVC) if(NOT MSVC)
#add_target_compile_flags(disk_new "-Wno-error -Wno-format -Wno-pointer-sign") #add_target_compile_flags(disk_new "-Wno-error -Wno-format -Wno-pointer-sign")

View file

@ -32,7 +32,7 @@ add_library(classpnp SHARED
${SOURCE} ${SOURCE}
class.rc) class.rc)
if(ARCH MATCHES i386) if(ARCH STREQUAL "i386")
# FIXME: http://www.cmake.org/Bug/view.php?id=12998 # FIXME: http://www.cmake.org/Bug/view.php?id=12998
if(MSVC) if(MSVC)
#add_target_compile_flags(classpnp "/Gz") #add_target_compile_flags(classpnp "/Gz")

View file

@ -1,8 +1,8 @@
if((ARCH MATCHES i386) OR (ARCH MATCHES amd64)) if((ARCH STREQUAL "i386") OR (ARCH STREQUAL "amd64"))
add_subdirectory(halx86) add_subdirectory(halx86)
elseif(ARCH MATCHES arm) elseif(ARCH STREQUAL "arm")
# add_subdirectory(halarm) # add_subdirectory(halarm)
elseif(ARCH MATCHES powerpc) elseif(ARCH STREQUAL "powerpc")
# add_subdirectory(halppc) # add_subdirectory(halppc)
endif() endif()

View file

@ -20,7 +20,7 @@ list(APPEND HAL_GENERIC_SOURCE
generic/sysinfo.c generic/sysinfo.c
generic/usage.c) generic/usage.c)
if(ARCH STREQUAL i386) if(ARCH STREQUAL "i386")
list(APPEND HAL_GENERIC_SOURCE list(APPEND HAL_GENERIC_SOURCE
generic/bios.c generic/bios.c
generic/portio.c) generic/portio.c)
@ -104,7 +104,7 @@ list(APPEND HAL_APIC_SOURCE
apic/tsc.c apic/tsc.c
apic/tsccal.S) apic/tsccal.S)
if(ARCH STREQUAL i386) if(ARCH STREQUAL "i386")
list(APPEND MINI_HAL_SOURCE list(APPEND MINI_HAL_SOURCE
generic/portio.c generic/portio.c
generic/systimer.S generic/systimer.S
@ -207,7 +207,7 @@ if(ARCH STREQUAL i386)
add_target_compile_definitions(mini_hal _BLDR_ _MINIHAL_) add_target_compile_definitions(mini_hal _BLDR_ _MINIHAL_)
add_dependencies(mini_hal psdk bugcodes asm) add_dependencies(mini_hal psdk bugcodes asm)
elseif(ARCH STREQUAL amd64) elseif(ARCH STREQUAL "amd64")
spec2def(hal.dll ../hal.spec ADD_IMPORTLIB) spec2def(hal.dll ../hal.spec ADD_IMPORTLIB)

View file

@ -10,9 +10,9 @@ else()
set(OPT_MS "") set(OPT_MS "")
endif() endif()
if(ARCH MATCHES i386) if(ARCH STREQUAL "i386")
set(_filename ks386) set(_filename ks386)
elseif(ARCH MATCHES amd64) elseif(ARCH STREQUAL "amd64")
set(_filename ksamd64) set(_filename ksamd64)
endif() endif()

View file

@ -1,5 +1,5 @@
if(ARCH MATCHES amd64) if(ARCH STREQUAL "amd64")
add_library(ndk_tests add_library(ndk_tests
win2003_x64.c win2003_x64.c
winvista_x64.c winvista_x64.c

View file

@ -4,7 +4,7 @@ macro(today RESULT)
string(STRIP ${${RESULT}} ${RESULT}) string(STRIP ${${RESULT}} ${RESULT})
elseif(CMAKE_HOST_UNIX) elseif(CMAKE_HOST_UNIX)
execute_process(COMMAND "date" "+%Y%m%d" OUTPUT_VARIABLE ${RESULT}) execute_process(COMMAND "date" "+%Y%m%d" OUTPUT_VARIABLE ${RESULT})
string(STRIP ${${RESULT}} ${RESULT}) string(STRIP ${${RESULT}} ${RESULT})
else() else()
message(SEND_ERROR "date not implemented") message(SEND_ERROR "date not implemented")
set(${RESULT} 00000000) set(${RESULT} 00000000)

View file

@ -6,7 +6,7 @@ include_directories(
${REACTOS_SOURCE_DIR}/lib/drivers/lwip/src/include ${REACTOS_SOURCE_DIR}/lib/drivers/lwip/src/include
${REACTOS_SOURCE_DIR}/lib/drivers/lwip/src/include/ipv4) ${REACTOS_SOURCE_DIR}/lib/drivers/lwip/src/include/ipv4)
if(ARCH MATCHES i386) if(ARCH STREQUAL "i386")
list(APPEND SOURCE network/i386/checksum.S) list(APPEND SOURCE network/i386/checksum.S)
endif() endif()

View file

@ -1,7 +1,7 @@
list(APPEND SOURCE dummy.c) list(APPEND SOURCE dummy.c)
if(ARCH MATCHES powerpc) if(ARCH STREQUAL "powerpc")
list(APPEND SOURCE mmuutil.c) list(APPEND SOURCE mmuutil.c)
endif() endif()

View file

@ -2,14 +2,14 @@
if(NOT MSVC) if(NOT MSVC)
list(APPEND SOURCE framebased.c) list(APPEND SOURCE framebased.c)
if(ARCH MATCHES i386) if(ARCH STREQUAL "i386")
list(APPEND SOURCE list(APPEND SOURCE
i386/framebased.S i386/framebased.S
i386/framebased-gcchack.c i386/framebased-gcchack.c
i386/framebased-gcchack-asm.S) i386/framebased-gcchack-asm.S)
elseif(ARCH MATCHES amd64) elseif(ARCH STREQUAL "amd64")
list(APPEND SOURCE amd64/framebased.S) list(APPEND SOURCE amd64/framebased.S)
elseif(ARCH MATCHES powerpc) elseif(ARCH STREQUAL "powerpc")
list(APPEND SOURCE powerpc/framebased.S) list(APPEND SOURCE powerpc/framebased.S)
endif() endif()
@ -20,12 +20,12 @@ if(NOT MSVC)
else() else()
if(ARCH MATCHES i386) if(ARCH STREQUAL "i386")
list(APPEND SOURCE list(APPEND SOURCE
dummy.c dummy.c
i386/seh.s i386/seh.s
i386/seh_prolog.s) i386/seh_prolog.s)
elseif(ARCH MATCHES amd64) elseif(ARCH STREQUAL "amd64")
list(APPEND SOURCE list(APPEND SOURCE
dummy.c dummy.c
amd64/seh.s amd64/seh.s

View file

@ -63,7 +63,7 @@ list(APPEND SOURCE
wait.c wait.c
workitem.c) workitem.c)
if(ARCH MATCHES i386) if(ARCH STREQUAL "i386")
list(APPEND SOURCE list(APPEND SOURCE
i386/debug_asm.S i386/debug_asm.S
i386/except_asm.s i386/except_asm.s
@ -73,7 +73,7 @@ if(ARCH MATCHES i386)
i386/rtlswap.S i386/rtlswap.S
i386/res_asm.s i386/res_asm.s
i386/thread.c) i386/thread.c)
elseif(ARCH MATCHES amd64) elseif(ARCH STREQUAL "amd64")
list(APPEND SOURCE list(APPEND SOURCE
byteswap.c byteswap.c
amd64/debug_asm.S amd64/debug_asm.S
@ -82,12 +82,12 @@ elseif(ARCH MATCHES amd64)
amd64/unwind.c amd64/unwind.c
amd64/stubs.c amd64/stubs.c
mem.c) mem.c)
elseif(ARCH MATCHES arm) elseif(ARCH STREQUAL "arm")
list(APPEND SOURCE list(APPEND SOURCE
byteswap.c byteswap.c
arm/debug_asm.S arm/debug_asm.S
mem.c) mem.c)
elseif(ARCH MATCHES powerpc) elseif(ARCH STREQUAL "powerpc")
list(APPEND SOURCE list(APPEND SOURCE
byteswap.c byteswap.c
powerpc/debug.c powerpc/debug.c

View file

@ -3,17 +3,17 @@ include_directories(include)
add_definitions(-D_CRTBLD) add_definitions(-D_CRTBLD)
if(ARCH MATCHES i386) if(ARCH STREQUAL "i386")
list(APPEND CHKSTK_SOURCE except/i386/chkstk_asm.s) list(APPEND CHKSTK_SOURCE except/i386/chkstk_asm.s)
if(NOT MSVC) if(NOT MSVC)
list(APPEND CHKSTK_SOURCE except/i386/chkstk_ms.s) list(APPEND CHKSTK_SOURCE except/i386/chkstk_ms.s)
endif() endif()
elseif(ARCH MATCHES amd64) elseif(ARCH STREQUAL "amd64")
list(APPEND CHKSTK_SOURCE except/amd64/chkstk_asm.s) list(APPEND CHKSTK_SOURCE except/amd64/chkstk_asm.s)
if(NOT MSVC) if(NOT MSVC)
list(APPEND CHKSTK_SOURCE except/amd64/chkstk_ms.s) list(APPEND CHKSTK_SOURCE except/amd64/chkstk_ms.s)
endif() endif()
elseif(ARCH MATCHES powerpc) elseif(ARCH STREQUAL "powerpc")
list(APPEND CHKSTK_SOURCE except/powerpc/chkstk_asm.s) list(APPEND CHKSTK_SOURCE except/powerpc/chkstk_asm.s)
endif() endif()

View file

@ -339,7 +339,7 @@ list(APPEND CRT_SOURCE
wine/heap.c wine/heap.c
wine/undname.c) wine/undname.c)
if(ARCH MATCHES i386) if(ARCH STREQUAL "i386")
list(APPEND CRT_SOURCE list(APPEND CRT_SOURCE
except/i386/chkesp.s except/i386/chkesp.s
except/i386/prolog.s except/i386/prolog.s
@ -416,7 +416,7 @@ if(ARCH MATCHES i386)
list(APPEND CRT_SOURCE list(APPEND CRT_SOURCE
except/i386/cpp.s) except/i386/cpp.s)
endif() endif()
elseif(ARCH MATCHES amd64) elseif(ARCH STREQUAL "amd64")
list(APPEND CRT_SOURCE list(APPEND CRT_SOURCE
except/amd64/seh.s except/amd64/seh.s
except/amd64/ehandler.c except/amd64/ehandler.c
@ -452,7 +452,7 @@ elseif(ARCH MATCHES amd64)
endif() endif()
endif() endif()
if(NOT ARCH MATCHES i386) if(NOT ARCH STREQUAL "i386")
list(APPEND CRT_SOURCE list(APPEND CRT_SOURCE
math/cos.c math/cos.c
math/sin.c math/sin.c

View file

@ -65,7 +65,7 @@ list(APPEND LIBCNTPR_SOURCE
wstring/wcsspn.c wstring/wcsspn.c
wstring/wcsstr.c) wstring/wcsstr.c)
if(ARCH MATCHES i386) if(ARCH STREQUAL "i386")
list(APPEND LIBCNTPR_SOURCE list(APPEND LIBCNTPR_SOURCE
except/i386/chkstk_asm.s except/i386/chkstk_asm.s
except/i386/seh.s except/i386/seh.s
@ -104,7 +104,7 @@ if(ARCH MATCHES i386)
if(NOT MSVC) if(NOT MSVC)
list(APPEND LIBCNTPR_SOURCE except/i386/chkstk_ms.s) list(APPEND LIBCNTPR_SOURCE except/i386/chkstk_ms.s)
endif() endif()
elseif(ARCH MATCHES amd64) elseif(ARCH STREQUAL "amd64")
list(APPEND LIBCNTPR_SOURCE list(APPEND LIBCNTPR_SOURCE
except/amd64/ehandler.c except/amd64/ehandler.c
except/amd64/chkstk_asm.s except/amd64/chkstk_asm.s
@ -128,7 +128,7 @@ elseif(ARCH MATCHES amd64)
math/amd64/tan.S) math/amd64/tan.S)
endif() endif()
if(ARCH MATCHES i386) if(ARCH STREQUAL "i386")
list(APPEND LIBCNTPR_SOURCE list(APPEND LIBCNTPR_SOURCE
mem/i386/memchr_asm.s mem/i386/memchr_asm.s
mem/i386/memmove_asm.s mem/i386/memmove_asm.s

View file

@ -47,7 +47,7 @@ if(NOT MSVC)
startup/pseudo-reloc-list.c) startup/pseudo-reloc-list.c)
endif() endif()
if(ARCH MATCHES i386) if(ARCH STREQUAL "i386")
list(APPEND MSVCRTEX_SOURCE list(APPEND MSVCRTEX_SOURCE
except/i386/chkstk_asm.s except/i386/chkstk_asm.s
except/i386/chkstk_ms.s except/i386/chkstk_ms.s
@ -59,7 +59,7 @@ if(ARCH MATCHES i386)
math/i386/cisqrt.c math/i386/cisqrt.c
math/i386/ftol2_asm.s math/i386/ftol2_asm.s
math/i386/alldiv_asm.s) math/i386/alldiv_asm.s)
elseif(ARCH MATCHES amd64) elseif(ARCH STREQUAL "amd64")
list(APPEND MSVCRTEX_SOURCE list(APPEND MSVCRTEX_SOURCE
except/amd64/chkstk_asm.s except/amd64/chkstk_asm.s
except/amd64/chkstk_ms.s) except/amd64/chkstk_ms.s)

View file

@ -276,7 +276,7 @@ list(APPEND SOURCE
wmi/wmi.c wmi/wmi.c
ntoskrnl.rc) ntoskrnl.rc)
if(ARCH MATCHES i386) if(ARCH STREQUAL "i386")
list(APPEND SOURCE list(APPEND SOURCE
config/i386/cmhardwr.c config/i386/cmhardwr.c
ex/i386/fastinterlck_asm.S ex/i386/fastinterlck_asm.S
@ -304,7 +304,7 @@ if(ARCH MATCHES i386)
rtl/i386/stack.S rtl/i386/stack.S
vdm/vdmmain.c vdm/vdmmain.c
vdm/vdmexec.c) vdm/vdmexec.c)
elseif(ARCH MATCHES amd64) elseif(ARCH STREQUAL "amd64")
list(APPEND SOURCE list(APPEND SOURCE
config/i386/cmhardwr.c config/i386/cmhardwr.c
ke/amd64/boot.S ke/amd64/boot.S
@ -323,7 +323,7 @@ elseif(ARCH MATCHES amd64)
mm/amd64/init.c mm/amd64/init.c
mm/amd64/page.c mm/amd64/page.c
ps/amd64/psctx.c) ps/amd64/psctx.c)
elseif(ARCH MATCHES arm) elseif(ARCH STREQUAL "arm")
list(APPEND SOURCE list(APPEND SOURCE
config/arm/cmhardwr.c config/arm/cmhardwr.c
ke/arm/boot.s ke/arm/boot.s
@ -340,7 +340,7 @@ elseif(ARCH MATCHES arm)
mm/ARM3/arm/init.c mm/ARM3/arm/init.c
ps/arm/psctx.c ps/arm/psctx.c
rtl/arm/rtlexcpt.c) rtl/arm/rtlexcpt.c)
elseif(ARCH MATCHES powerpc) elseif(ARCH STREQUAL "powerpc")
list(APPEND SOURCE list(APPEND SOURCE
config/powerpc/cmhardwr.c config/powerpc/cmhardwr.c
ke/powerpc/main_asm.S ke/powerpc/main_asm.S
@ -358,7 +358,7 @@ elseif(ARCH MATCHES powerpc)
endif() endif()
if(NOT _WINKD_) if(NOT _WINKD_)
if(ARCH MATCHES i386) if(ARCH STREQUAL "i386")
list(APPEND SOURCE list(APPEND SOURCE
kd/i386/kdmemsup.c kd/i386/kdmemsup.c
kd/wrappers/gdbstub.c) kd/wrappers/gdbstub.c)
@ -367,7 +367,7 @@ if(NOT _WINKD_)
kdbg/i386/i386-dis.c kdbg/i386/i386-dis.c
kdbg/i386/kdb_help.S) kdbg/i386/kdb_help.S)
endif() endif()
elseif(ARCH MATCHES amd64) elseif(ARCH STREQUAL "amd64")
list(APPEND SOURCE list(APPEND SOURCE
kd/amd64/kd.c kd/amd64/kd.c
kd/amd64/kdmemsup.c) kd/amd64/kdmemsup.c)
@ -377,7 +377,7 @@ if(NOT _WINKD_)
kdbg/amd64/kdb_help.S kdbg/amd64/kdb_help.S
kdbg/amd64/kdb.c) kdbg/amd64/kdb.c)
endif() endif()
elseif(ARCH MATCHES powerpc) elseif(ARCH STREQUAL "powerpc")
list(APPEND SOURCE kd/wrappers/gdbstub_powerpc.c) list(APPEND SOURCE kd/wrappers/gdbstub_powerpc.c)
endif() endif()
@ -413,11 +413,11 @@ else() # _WINKD_
kd64/kdprint.c kd64/kdprint.c
kd64/kdtrap.c) kd64/kdtrap.c)
if(ARCH MATCHES i386) if(ARCH STREQUAL "i386")
list(APPEND SOURCE kd64/i386/kdx86.c) list(APPEND SOURCE kd64/i386/kdx86.c)
elseif(ARCH MATCHES amd64) elseif(ARCH STREQUAL "amd64")
list(APPEND SOURCE kd64/amd64/kdx64.c) list(APPEND SOURCE kd64/amd64/kdx64.c)
elseif(ARCH MATCHES arm) elseif(ARCH STREQUAL "arm")
list(APPEND SOURCE kd64/arm/kdarm.c) list(APPEND SOURCE kd64/arm/kdarm.c)
endif() endif()
@ -427,7 +427,7 @@ add_executable(ntoskrnl
${SOURCE} ${SOURCE}
${CMAKE_CURRENT_BINARY_DIR}/ntoskrnl.def) ${CMAKE_CURRENT_BINARY_DIR}/ntoskrnl.def)
if (ARCH MATCHES i386) if(ARCH STREQUAL "i386")
set_entrypoint(ntoskrnl KiSystemStartup 4) set_entrypoint(ntoskrnl KiSystemStartup 4)
else() else()
set_entrypoint(ntoskrnl KiSystemStartup) set_entrypoint(ntoskrnl KiSystemStartup)
@ -472,7 +472,7 @@ if(BUILD_MP)
add_target_compile_definitions(ntkrnlmp CONFIG_SMP) add_target_compile_definitions(ntkrnlmp CONFIG_SMP)
if(ARCH MATCHES i386) if(ARCH STREQUAL "i386")
set_entrypoint(ntkrnlmp KiSystemStartup 4) set_entrypoint(ntkrnlmp KiSystemStartup 4)
else() else()
set_entrypoint(ntkrnlmp KiSystemStartup) set_entrypoint(ntkrnlmp KiSystemStartup)

View file

@ -1,4 +1,4 @@
if(ARCH MATCHES i386) if(ARCH STREQUAL "i386")
add_subdirectory(ntvdm) add_subdirectory(ntvdm)
endif() endif()
add_subdirectory(csr) add_subdirectory(csr)

View file

@ -5,17 +5,17 @@ endif()
# Choose the right MinGW toolchain prefix # Choose the right MinGW toolchain prefix
if (NOT DEFINED MINGW_TOOLCHAIN_PREFIX) if (NOT DEFINED MINGW_TOOLCHAIN_PREFIX)
if(ARCH MATCHES i386) if(ARCH STREQUAL "i386")
if(CMAKE_HOST_SYSTEM_NAME MATCHES Windows) if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
set(MINGW_TOOLCHAIN_PREFIX "" CACHE STRING "MinGW Toolchain Prefix") set(MINGW_TOOLCHAIN_PREFIX "" CACHE STRING "MinGW Toolchain Prefix")
else() else()
set(MINGW_TOOLCHAIN_PREFIX "mingw32-" CACHE STRING "MinGW Toolchain Prefix") set(MINGW_TOOLCHAIN_PREFIX "mingw32-" CACHE STRING "MinGW Toolchain Prefix")
endif(CMAKE_HOST_SYSTEM_NAME MATCHES Windows) endif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
elseif(ARCH MATCHES amd64) elseif(ARCH STREQUAL "amd64")
set(MINGW_TOOLCHAIN_PREFIX "x86_64-w64-mingw32-" CACHE STRING "MinGW Toolchain Prefix") set(MINGW_TOOLCHAIN_PREFIX "x86_64-w64-mingw32-" CACHE STRING "MinGW Toolchain Prefix")
elseif(ARCH MATCHES arm) elseif(ARCH STREQUAL "arm")
set(MINGW_TOOLCHAIN_PREFIX "arm-mingw32ce-" CACHE STRING "MinGW Toolchain Prefix") set(MINGW_TOOLCHAIN_PREFIX "arm-mingw32ce-" CACHE STRING "MinGW Toolchain Prefix")
endif() endif()
endif() endif()
@ -43,7 +43,7 @@ set(CMAKE_MC_COMPILER ${MINGW_TOOLCHAIN_PREFIX}windmc)
set(CMAKE_RC_COMPILER ${MINGW_TOOLCHAIN_PREFIX}windres) set(CMAKE_RC_COMPILER ${MINGW_TOOLCHAIN_PREFIX}windres)
set(CMAKE_DLLTOOL ${MINGW_TOOLCHAIN_PREFIX}dlltool) set(CMAKE_DLLTOOL ${MINGW_TOOLCHAIN_PREFIX}dlltool)
if(NOT CMAKE_HOST_SYSTEM_NAME MATCHES Windows) if(NOT CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
set(CMAKE_C_CREATE_STATIC_LIBRARY "<CMAKE_AR> crs <TARGET> <LINK_FLAGS> <OBJECTS>") set(CMAKE_C_CREATE_STATIC_LIBRARY "<CMAKE_AR> crs <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_CXX_CREATE_STATIC_LIBRARY ${CMAKE_C_CREATE_STATIC_LIBRARY}) set(CMAKE_CXX_CREATE_STATIC_LIBRARY ${CMAKE_C_CREATE_STATIC_LIBRARY})
set(CMAKE_ASM_CREATE_STATIC_LIBRARY ${CMAKE_C_CREATE_STATIC_LIBRARY}) set(CMAKE_ASM_CREATE_STATIC_LIBRARY ${CMAKE_C_CREATE_STATIC_LIBRARY})

View file

@ -1,4 +1,8 @@
if(NOT ARCH)
set(ARCH i386)
endif()
# the name of the target operating system # the name of the target operating system
set(CMAKE_SYSTEM_NAME Windows) set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_SYSTEM_PROCESSOR i686) set(CMAKE_SYSTEM_PROCESSOR i686)
@ -8,7 +12,7 @@ set(CMAKE_C_COMPILER cl)
set(CMAKE_CXX_COMPILER cl) set(CMAKE_CXX_COMPILER cl)
set(CMAKE_MC_COMPILER mc) set(CMAKE_MC_COMPILER mc)
set(CMAKE_RC_COMPILER rc) set(CMAKE_RC_COMPILER rc)
if(${ARCH} MATCHES amd64) if(ARCH STREQUAL "amd64")
set(CMAKE_ASM_COMPILER ml64) set(CMAKE_ASM_COMPILER ml64)
else() else()
set(CMAKE_ASM_COMPILER ml) set(CMAKE_ASM_COMPILER ml)
@ -17,6 +21,6 @@ set(CMAKE_ASM_COMPILER_ID "VISUAL")
set(CMAKE_C_STANDARD_LIBRARIES "" CACHE INTERNAL "") set(CMAKE_C_STANDARD_LIBRARIES "" CACHE INTERNAL "")
if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86") if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86")
add_definitions(-D__i386__) add_definitions(-D__i386__)
endif() endif()

View file

@ -1,7 +1,7 @@
if(ARCH MATCHES i386) if(ARCH STREQUAL "i386")
add_executable(rsym rsym_common.c rsym.c) add_executable(rsym rsym_common.c rsym.c)
elseif(ARCH MATCHES amd64) elseif(ARCH STREQUAL "amd64")
add_executable(rsym rsym_common.c rsym64.c) add_executable(rsym rsym_common.c rsym64.c)
endif() endif()
add_executable(raddr2line rsym_common.c raddr2line.c) add_executable(raddr2line rsym_common.c raddr2line.c)

View file

@ -189,7 +189,7 @@ else()
${GENDIB_FILES}) ${GENDIB_FILES})
endif() endif()
if(ARCH MATCHES i386) if(ARCH STREQUAL "i386")
list(APPEND SOURCE list(APPEND SOURCE
gdi/dib/i386/dib24bpp_hline.s gdi/dib/i386/dib24bpp_hline.s
gdi/dib/i386/dib32bpp_hline.s gdi/dib/i386/dib32bpp_hline.s

View file

@ -13,7 +13,7 @@ add_library(framebuf_new SHARED
${SOURCE} ${SOURCE}
framebuf_new.rc) framebuf_new.rc)
if(ARCH MATCHES i386) if(ARCH STREQUAL "i386")
# FIXME: http://www.cmake.org/Bug/view.php?id=12998 # FIXME: http://www.cmake.org/Bug/view.php?id=12998
if(MSVC) if(MSVC)
#add_target_compile_flags(framebuf_new "/Gz") #add_target_compile_flags(framebuf_new "/Gz")

View file

@ -8,7 +8,7 @@ include_directories(
spec2def(gdi32.dll gdi32.spec ADD_IMPORTLIB) spec2def(gdi32.dll gdi32.spec ADD_IMPORTLIB)
if(ARCH MATCHES i386) if(ARCH STREQUAL "i386")
list(APPEND SOURCE list(APPEND SOURCE
objects/efloat.c) objects/efloat.c)
endif() endif()