* 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)
set(ARCH i386)
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)
# Compile options
if(ARCH MATCHES i386)
if(ARCH STREQUAL "i386")
include(cmake/config.cmake)
elseif(ARCH MATCHES amd64)
elseif(ARCH STREQUAL "amd64")
include(cmake/config-amd64.cmake)
elseif(ARCH MATCHES arm)
elseif(ARCH STREQUAL "arm")
include(cmake/config-arm.cmake)
endif()
@ -50,7 +55,7 @@ if(NOT CMAKE_CROSSCOMPILING)
add_definitions(-DTARGET_${ARCH})
if(MSVC)
if(ARCH MATCHES i386)
if(ARCH STREQUAL "i386")
add_definitions(/D_X86_ /DWIN32 /D_WINDOWS)
endif()
add_definitions(/Dinline=__inline)
@ -128,21 +133,21 @@ else()
-D_SETUPAPI_VER=0x502)
# Arch Options
if(ARCH MATCHES i386)
if(ARCH STREQUAL "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)
elseif(ARCH MATCHES arm)
elseif(ARCH STREQUAL "arm")
# _M_ARM is already defined by toolchain
add_definitions(-D_ARM_ -D__arm__)
endif()
# Other
if(ARCH MATCHES i386)
if(ARCH STREQUAL "i386")
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)
elseif(ARCH MATCHES arm)
elseif(ARCH STREQUAL "arm")
add_definitions(-DUSE_COMPILER_EXCEPTIONS)
endif()
@ -203,7 +208,7 @@ else()
endif()
if(ARCH MATCHES arm)
if(ARCH STREQUAL "arm")
include_directories(${REACTOS_SOURCE_DIR}/include/reactos/arm)
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(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)
if(ARCH MATCHES i386)
if(ARCH STREQUAL "i386")
CreateBootSectorTarget(frldr16
${CMAKE_CURRENT_SOURCE_DIR}/arch/realmode/i386.S
${CMAKE_CURRENT_BINARY_DIR}/frldr16.bin
F800)
elseif(ARCH MATCHES amd64)
elseif(ARCH STREQUAL "amd64")
CreateBootSectorTarget(frldr16
${CMAKE_CURRENT_SOURCE_DIR}/arch/realmode/amd64.S
${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_)
if(ARCH MATCHES arm)
if(SARCH MATCHES omap-zoom2)
add_definitions(-D_ZOOM2_)
endif()
if((ARCH STREQUAL "arm") AND (SARCH STREQUAL "omap-zoom2"))
add_definitions(-D_ZOOM2_)
endif()
list(APPEND FREELDR_COMMON_SOURCE
@ -80,7 +78,7 @@ list(APPEND FREELDR_COMMON_SOURCE
windows/wlmemory.c
windows/wlregistry.c)
if(ARCH MATCHES i386)
if(ARCH STREQUAL "i386")
list(APPEND FREELDR_COMMON_SOURCE
arch/i386/archmach.c
arch/i386/custom.c
@ -125,7 +123,7 @@ if(ARCH MATCHES i386)
list(APPEND FREELDR_COMMON_SOURCE
arch/i386/drvmap.S)
endif()
elseif(ARCH MATCHES amd64)
elseif(ARCH STREQUAL "amd64")
list(APPEND FREELDR_COMMON_SOURCE
arch/amd64/entry.S
arch/amd64/int386.S
@ -157,7 +155,7 @@ else()
add_dependencies(freeldr_common bugcodes)
endif()
if(ARCH MATCHES i386 AND NOT MSVC)
if(ARCH STREQUAL "i386" AND NOT MSVC)
list(APPEND FREELDR_BASE_SOURCE arch/i386/multiboot.S)
endif()
@ -197,7 +195,7 @@ set_image_base(freeldr_pe_dbg 0x10000)
set_subsystem(freeldr_pe_dbg native)
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_dbg mini_hal)
endif()
@ -229,7 +227,7 @@ add_cd_file(TARGET freeldr FILE ${CMAKE_CURRENT_BINARY_DIR}/freeldr.sys DESTINAT
list(APPEND SETUPLDR_SOURCE
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)
endif()
@ -262,7 +260,7 @@ set_image_base(setupldr_pe_dbg 0x10000)
set_subsystem(setupldr_pe_dbg native)
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_dbg mini_hal)
endif()

View file

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

View file

@ -28,7 +28,7 @@ set(GDB FALSE CACHE BOOL
"Whether to compile for debugging with GDB.
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
"Whether to compile for debugging.")
else()
@ -39,7 +39,7 @@ endif()
if(MSVC)
set(KDBG FALSE CACHE BOOL
"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.")
else()
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)
#workaround
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})
endif()
add_compile_flags("-fdebug-prefix-map=\"${REACTOS_SOURCE_DIR_NATIVE}\"=ReactOS")
@ -37,7 +37,7 @@ if(DEFINED CMAKE_SHARED_LIBRARY_ASM_FLAGS)
endif()
# Tuning
if(ARCH MATCHES i386)
if(ARCH STREQUAL "i386")
add_compile_flags("-march=${OARCH} -mtune=${TUNE}")
else()
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")
endif()
if(ARCH MATCHES amd64)
if(ARCH STREQUAL "amd64")
add_compile_flags("-Wno-format")
elseif(ARCH MATCHES arm)
elseif(ARCH STREQUAL "arm")
add_compile_flags("-Wno-attributes")
endif()
@ -80,26 +80,26 @@ endif()
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")
if(OPTIMIZE STREQUAL "1")
add_compile_flags("-ftracer -momit-leaf-frame-pointer")
endif()
elseif(ARCH MATCHES amd64)
elseif(ARCH STREQUAL "amd64")
add_compile_flags("-mpreferred-stack-boundary=4")
if(OPTIMIZE STREQUAL "1")
add_compile_flags("-ftracer -momit-leaf-frame-pointer")
endif()
elseif(ARCH MATCHES arm)
elseif(ARCH STREQUAL "arm")
if(OPTIMIZE STREQUAL "1")
add_compile_flags("-ftracer")
endif()
endif()
# Other
if(ARCH MATCHES amd64)
if(ARCH STREQUAL "amd64")
add_definitions(-U_X86_ -UWIN32)
elseif(ARCH MATCHES arm)
elseif(ARCH STREQUAL "arm")
add_definitions(-U_UNICODE -UUNICODE)
add_definitions(-D__MSVCRT__) # DUBIOUS
endif()
@ -107,7 +107,7 @@ endif()
add_definitions(-D_inline=__inline)
# alternative arch name
if(ARCH MATCHES amd64)
if(ARCH STREQUAL "amd64")
set(ARCH2 x86_64)
else()
set(ARCH2 ${ARCH})
@ -117,7 +117,7 @@ if(SEPARATE_DBG)
# PDB style debug puts all dwarf debug info in a separate dbg file
message(STATUS "Building separate debug symbols")
file(MAKE_DIRECTORY ${REACTOS_BINARY_DIR}/symbols)
if(CMAKE_GENERATOR MATCHES "Ninja")
if(CMAKE_GENERATOR STREQUAL "Ninja")
set(SYMBOL_FILE <TARGET_PDB>)
else()
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)
if(${ENTRYPOINT} STREQUAL "0")
add_target_link_flags(${MODULE} "-Wl,-entry,0")
elseif(ARCH MATCHES i386)
elseif(ARCH STREQUAL "i386")
set(_entrysymbol _${ENTRYPOINT})
if(${ARGC} GREATER 2)
set(_entrysymbol ${_entrysymbol}@${ARGV2})
@ -201,7 +201,7 @@ function(set_module_type_toolchain MODULE TYPE)
target_link_libraries(${MODULE} -lstdc++ -lsupc++ -lgcc -lmingwex)
endif()
if(${TYPE} STREQUAL kernelmodedriver)
if(${TYPE} STREQUAL "kernelmodedriver")
add_target_link_flags(${MODULE} "-Wl,--exclude-all-symbols,-file-alignment=0x1000,-section-alignment=0x1000")
endif()
endfunction()
@ -216,7 +216,7 @@ function(add_delay_importlibs MODULE)
target_link_libraries(${MODULE} delayimp)
endfunction()
if(NOT ARCH MATCHES i386)
if(NOT ARCH STREQUAL "i386")
set(DECO_OPTION "-@")
endif()

View file

@ -1,8 +1,8 @@
#idl files support
if(ARCH MATCHES i386)
if(ARCH STREQUAL "i386")
set(IDL_FLAGS /nologo /win32 /no_def_idir)
elseif(ARCH MATCHES amd64)
elseif(ARCH STREQUAL "amd64")
set(IDL_FLAGS /nologo /amd64 /no_def_idir)
else()
set(IDL_FLAGS /nologo /no_def_idir)
@ -55,11 +55,11 @@ function(add_rpc_files _type)
get_includes(_includes)
get_defines(_defines)
# Is it a client or server module?
if(_type STREQUAL server)
if(_type STREQUAL "server")
set(_server_client /sstub)
set(_suffix _s)
set(_prevent_second_type /client none)
elseif(_type STREQUAL client)
elseif(_type STREQUAL "client")
set(_server_client /cstub)
set(_suffix _c)
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
elseif(OPTIMIZE STREQUAL "1")
add_definitions(/O1)
@ -13,7 +14,7 @@ elseif(OPTIMIZE STREQUAL "5")
add_definitions(/GF /Gy /Ob2 /Os /Ox /GS-)
endif()
if(ARCH MATCHES i386)
if(ARCH STREQUAL "i386")
add_definitions(/DWIN32 /D_WINDOWS)
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
# 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")
endif ()
@ -31,12 +32,14 @@ endif ()
add_compile_flags("/we4700")
# 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_))
add_compile_flags("/Zi")
endif()
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")
endif()
@ -87,7 +90,7 @@ endmacro()
function(set_entrypoint _module _entrypoint)
if(${_entrypoint} STREQUAL "0")
add_target_link_flags(${_module} "/NOENTRY")
elseif(ARCH MATCHES i386)
elseif(ARCH STREQUAL "i386")
set(_entrysymbol ${_entrypoint})
if(${ARGC} GREATER 2)
set(_entrysymbol ${_entrysymbol}@${ARGV2})
@ -107,9 +110,9 @@ function(set_image_base MODULE IMAGE_BASE)
endfunction()
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")
elseif(${TYPE} STREQUAL kernelmodedriver)
elseif(${TYPE} STREQUAL "kernelmodedriver")
add_target_link_flags(${MODULE} "/DRIVER")
endif()
endfunction()
@ -166,7 +169,7 @@ function(generate_import_lib _libname _dllname _spec_file)
set_target_properties(${_libname} PROPERTIES STATIC_LIBRARY_FLAGS "/DEF:${_def_file}")
endfunction()
if(${ARCH} MATCHES amd64)
if(ARCH STREQUAL "amd64")
add_definitions(/D__x86_64)
set(SPEC2DEF_ARCH x86_64)
else()
@ -211,7 +214,7 @@ set(PSEH_LIB "pseh")
# 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,
# 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)
else()
set(CMAKE_ASM16_COMPILER ml.exe)

View file

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

View file

@ -25,15 +25,15 @@ list(APPEND SOURCE
def/ntdll.rc
${CMAKE_CURRENT_BINARY_DIR}/ntdll.def)
if(ARCH MATCHES i386)
if(ARCH STREQUAL "i386")
list(APPEND SOURCE dispatch/i386/dispatch.S)
elseif(ARCH MATCHES amd64)
elseif(ARCH STREQUAL "amd64")
list(APPEND SOURCE dispatch/amd64/dispatch.S)
elseif(ARCH MATCHES arm)
elseif(ARCH STREQUAL "arm")
list(APPEND SOURCE dispatch/arm/stubs_asm.s)
else()
list(APPEND SOURCE dispatch/dispatch.c)
endif(ARCH MATCHES i386)
endif(ARCH STREQUAL "i386")
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
# 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)
else()
list(APPEND SOURCE ../../state_trackers/wgl/opengl32.mingw.def)

View file

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

View file

@ -6,7 +6,7 @@ add_definitions(
-DHAVE_ALLOCA_H
-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)
endif()

View file

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

View file

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

View file

@ -5,16 +5,16 @@ list(APPEND SOURCE
bootvid.rc
${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
i386/bootvid.c
i386/bootdata.c
i386/vga.c)
elseif(ARCH MATCHES arm)
elseif(ARCH STREQUAL "arm")
list(APPEND SOURCE
arm/bootvid.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})

View file

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

View file

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

View file

@ -11,7 +11,7 @@ add_library(cdrom_new SHARED ${SOURCE})
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
if(MSVC)
#add_target_compile_flags(cdrom_new "/Gz")

View file

@ -14,7 +14,7 @@ add_library(disk_new SHARED
disk.rc)
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
if(NOT MSVC)
#add_target_compile_flags(disk_new "-Wno-error -Wno-format -Wno-pointer-sign")

View file

@ -32,7 +32,7 @@ add_library(classpnp SHARED
${SOURCE}
class.rc)
if(ARCH MATCHES i386)
if(ARCH STREQUAL "i386")
# FIXME: http://www.cmake.org/Bug/view.php?id=12998
if(MSVC)
#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)
elseif(ARCH MATCHES arm)
elseif(ARCH STREQUAL "arm")
# add_subdirectory(halarm)
elseif(ARCH MATCHES powerpc)
elseif(ARCH STREQUAL "powerpc")
# add_subdirectory(halppc)
endif()

View file

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

View file

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

View file

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

View file

@ -4,7 +4,7 @@ macro(today RESULT)
string(STRIP ${${RESULT}} ${RESULT})
elseif(CMAKE_HOST_UNIX)
execute_process(COMMAND "date" "+%Y%m%d" OUTPUT_VARIABLE ${RESULT})
string(STRIP ${${RESULT}} ${RESULT})
string(STRIP ${${RESULT}} ${RESULT})
else()
message(SEND_ERROR "date not implemented")
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/ipv4)
if(ARCH MATCHES i386)
if(ARCH STREQUAL "i386")
list(APPEND SOURCE network/i386/checksum.S)
endif()

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -5,17 +5,17 @@ endif()
# Choose the right 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")
else()
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")
elseif(ARCH MATCHES arm)
elseif(ARCH STREQUAL "arm")
set(MINGW_TOOLCHAIN_PREFIX "arm-mingw32ce-" CACHE STRING "MinGW Toolchain Prefix")
endif()
endif()
@ -43,7 +43,7 @@ set(CMAKE_MC_COMPILER ${MINGW_TOOLCHAIN_PREFIX}windmc)
set(CMAKE_RC_COMPILER ${MINGW_TOOLCHAIN_PREFIX}windres)
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_CXX_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
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_SYSTEM_PROCESSOR i686)
@ -8,7 +12,7 @@ set(CMAKE_C_COMPILER cl)
set(CMAKE_CXX_COMPILER cl)
set(CMAKE_MC_COMPILER mc)
set(CMAKE_RC_COMPILER rc)
if(${ARCH} MATCHES amd64)
if(ARCH STREQUAL "amd64")
set(CMAKE_ASM_COMPILER ml64)
else()
set(CMAKE_ASM_COMPILER ml)
@ -17,6 +21,6 @@ set(CMAKE_ASM_COMPILER_ID "VISUAL")
set(CMAKE_C_STANDARD_LIBRARIES "" CACHE INTERNAL "")
if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86")
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86")
add_definitions(-D__i386__)
endif()

View file

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

View file

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

View file

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

View file

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