diff --git a/reactos/CMakeLists.txt b/reactos/CMakeLists.txt index ebee4e6e2e9..7d8c28dcfc9 100644 --- a/reactos/CMakeLists.txt +++ b/reactos/CMakeLists.txt @@ -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() diff --git a/reactos/boot/freeldr/bootsect/CMakeLists.txt b/reactos/boot/freeldr/bootsect/CMakeLists.txt index c8c6c282f5b..dc60f6756c6 100644 --- a/reactos/boot/freeldr/bootsect/CMakeLists.txt +++ b/reactos/boot/freeldr/bootsect/CMakeLists.txt @@ -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) diff --git a/reactos/boot/freeldr/freeldr/CMakeLists.txt b/reactos/boot/freeldr/freeldr/CMakeLists.txt index 6b5adc31c4b..db983054447 100644 --- a/reactos/boot/freeldr/freeldr/CMakeLists.txt +++ b/reactos/boot/freeldr/freeldr/CMakeLists.txt @@ -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() diff --git a/reactos/cmake/CMakeMacros.cmake b/reactos/cmake/CMakeMacros.cmake index 68ea72a78be..9315a363dba 100644 --- a/reactos/cmake/CMakeMacros.cmake +++ b/reactos/cmake/CMakeMacros.cmake @@ -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() diff --git a/reactos/cmake/config.cmake b/reactos/cmake/config.cmake index d8ef1f652de..59ce32a015f 100644 --- a/reactos/cmake/config.cmake +++ b/reactos/cmake/config.cmake @@ -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.") diff --git a/reactos/cmake/gcc.cmake b/reactos/cmake/gcc.cmake index b3d318a3164..88d666875fc 100644 --- a/reactos/cmake/gcc.cmake +++ b/reactos/cmake/gcc.cmake @@ -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 ) else() set(SYMBOL_FILE .gdb) @@ -177,7 +177,7 @@ set(CMAKE_DEPFILE_FLAGS_RC "--preprocessor \" -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() diff --git a/reactos/cmake/midl-support.cmake b/reactos/cmake/midl-support.cmake index 213e940c0e8..e8793d1dda7 100644 --- a/reactos/cmake/midl-support.cmake +++ b/reactos/cmake/midl-support.cmake @@ -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) diff --git a/reactos/cmake/msvc.cmake b/reactos/cmake/msvc.cmake index 002166b611c..4e92f6c77dc 100644 --- a/reactos/cmake/msvc.cmake +++ b/reactos/cmake/msvc.cmake @@ -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) diff --git a/reactos/cmake/widl-support.cmake b/reactos/cmake/widl-support.cmake index 9a42fa2c2c9..39acbf82ab5 100644 --- a/reactos/cmake/widl-support.cmake +++ b/reactos/cmake/widl-support.cmake @@ -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() diff --git a/reactos/dll/ntdll/CMakeLists.txt b/reactos/dll/ntdll/CMakeLists.txt index fb5a3ea5e58..1a9047962b5 100644 --- a/reactos/dll/ntdll/CMakeLists.txt +++ b/reactos/dll/ntdll/CMakeLists.txt @@ -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}) diff --git a/reactos/dll/opengl/mesa/src/gallium/targets/libgl-gdi/CMakeLists.txt b/reactos/dll/opengl/mesa/src/gallium/targets/libgl-gdi/CMakeLists.txt index cab575efb2d..bbcadbf13d0 100644 --- a/reactos/dll/opengl/mesa/src/gallium/targets/libgl-gdi/CMakeLists.txt +++ b/reactos/dll/opengl/mesa/src/gallium/targets/libgl-gdi/CMakeLists.txt @@ -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) diff --git a/reactos/dll/win32/CMakeLists.txt b/reactos/dll/win32/CMakeLists.txt index 334cdad781f..9cd736cb14e 100644 --- a/reactos/dll/win32/CMakeLists.txt +++ b/reactos/dll/win32/CMakeLists.txt @@ -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) diff --git a/reactos/dll/win32/dbghelp/CMakeLists.txt b/reactos/dll/win32/dbghelp/CMakeLists.txt index ced3c50753d..82a4ffe3e0f 100644 --- a/reactos/dll/win32/dbghelp/CMakeLists.txt +++ b/reactos/dll/win32/dbghelp/CMakeLists.txt @@ -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() diff --git a/reactos/dll/win32/kernel32/CMakeLists.txt b/reactos/dll/win32/kernel32/CMakeLists.txt index 76632973f9b..ad5a2a3bded 100644 --- a/reactos/dll/win32/kernel32/CMakeLists.txt +++ b/reactos/dll/win32/kernel32/CMakeLists.txt @@ -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}) diff --git a/reactos/dll/win32/riched20/CMakeLists.txt b/reactos/dll/win32/riched20/CMakeLists.txt index 3f2c4e62327..9a2e48baa7b 100644 --- a/reactos/dll/win32/riched20/CMakeLists.txt +++ b/reactos/dll/win32/riched20/CMakeLists.txt @@ -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") diff --git a/reactos/drivers/base/bootvid/CMakeLists.txt b/reactos/drivers/base/bootvid/CMakeLists.txt index 18cdcb87472..43a1fc1be85 100644 --- a/reactos/drivers/base/bootvid/CMakeLists.txt +++ b/reactos/drivers/base/bootvid/CMakeLists.txt @@ -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}) diff --git a/reactos/drivers/base/kdcom/CMakeLists.txt b/reactos/drivers/base/kdcom/CMakeLists.txt index 691ffa36c4a..7f5718a170e 100644 --- a/reactos/drivers/base/kdcom/CMakeLists.txt +++ b/reactos/drivers/base/kdcom/CMakeLists.txt @@ -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}) diff --git a/reactos/drivers/bus/acpi/CMakeLists.txt b/reactos/drivers/bus/acpi/CMakeLists.txt index 9b22dbd6375..845df2fd6a4 100644 --- a/reactos/drivers/bus/acpi/CMakeLists.txt +++ b/reactos/drivers/bus/acpi/CMakeLists.txt @@ -3,7 +3,7 @@ include_directories( include acpica/include) -if(ARCH MATCHES amd64) +if(ARCH STREQUAL "amd64") add_definitions(-DWIN64) endif() diff --git a/reactos/drivers/storage/class/cdrom_new/CMakeLists.txt b/reactos/drivers/storage/class/cdrom_new/CMakeLists.txt index 467aff498b2..b8e0e593bfd 100644 --- a/reactos/drivers/storage/class/cdrom_new/CMakeLists.txt +++ b/reactos/drivers/storage/class/cdrom_new/CMakeLists.txt @@ -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") diff --git a/reactos/drivers/storage/class/disk_new/CMakeLists.txt b/reactos/drivers/storage/class/disk_new/CMakeLists.txt index 493d4a6e979..98e8139fa69 100644 --- a/reactos/drivers/storage/class/disk_new/CMakeLists.txt +++ b/reactos/drivers/storage/class/disk_new/CMakeLists.txt @@ -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") diff --git a/reactos/drivers/storage/classpnp/CMakeLists.txt b/reactos/drivers/storage/classpnp/CMakeLists.txt index 6632c40c625..56e2a1971a1 100644 --- a/reactos/drivers/storage/classpnp/CMakeLists.txt +++ b/reactos/drivers/storage/classpnp/CMakeLists.txt @@ -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") diff --git a/reactos/hal/CMakeLists.txt b/reactos/hal/CMakeLists.txt index 3d4b3b2efe7..e767918faa5 100644 --- a/reactos/hal/CMakeLists.txt +++ b/reactos/hal/CMakeLists.txt @@ -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() diff --git a/reactos/hal/halx86/CMakeLists.txt b/reactos/hal/halx86/CMakeLists.txt index aa636d03751..762c4beee3f 100644 --- a/reactos/hal/halx86/CMakeLists.txt +++ b/reactos/hal/halx86/CMakeLists.txt @@ -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) diff --git a/reactos/include/asm/CMakeLists.txt b/reactos/include/asm/CMakeLists.txt index 3de03de2817..e111190e574 100644 --- a/reactos/include/asm/CMakeLists.txt +++ b/reactos/include/asm/CMakeLists.txt @@ -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() diff --git a/reactos/include/ndk/tests/CMakeLists.txt b/reactos/include/ndk/tests/CMakeLists.txt index fd48b5ff5ea..ddcff9fca48 100644 --- a/reactos/include/ndk/tests/CMakeLists.txt +++ b/reactos/include/ndk/tests/CMakeLists.txt @@ -1,5 +1,5 @@ -if(ARCH MATCHES amd64) +if(ARCH STREQUAL "amd64") add_library(ndk_tests win2003_x64.c winvista_x64.c diff --git a/reactos/include/reactos/version.cmake b/reactos/include/reactos/version.cmake index 3cd88886d48..a68ee50c268 100644 --- a/reactos/include/reactos/version.cmake +++ b/reactos/include/reactos/version.cmake @@ -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) diff --git a/reactos/lib/drivers/ip/CMakeLists.txt b/reactos/lib/drivers/ip/CMakeLists.txt index eb480c75804..20c900577e8 100644 --- a/reactos/lib/drivers/ip/CMakeLists.txt +++ b/reactos/lib/drivers/ip/CMakeLists.txt @@ -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() diff --git a/reactos/lib/ppcmmu/CMakeLists.txt b/reactos/lib/ppcmmu/CMakeLists.txt index cfc19367eed..7fc3c08d79b 100644 --- a/reactos/lib/ppcmmu/CMakeLists.txt +++ b/reactos/lib/ppcmmu/CMakeLists.txt @@ -1,7 +1,7 @@ list(APPEND SOURCE dummy.c) -if(ARCH MATCHES powerpc) +if(ARCH STREQUAL "powerpc") list(APPEND SOURCE mmuutil.c) endif() diff --git a/reactos/lib/pseh/CMakeLists.txt b/reactos/lib/pseh/CMakeLists.txt index 128f54566a6..7f3bc5328b8 100644 --- a/reactos/lib/pseh/CMakeLists.txt +++ b/reactos/lib/pseh/CMakeLists.txt @@ -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 diff --git a/reactos/lib/rtl/CMakeLists.txt b/reactos/lib/rtl/CMakeLists.txt index b48f4bac36d..a6becccc85c 100644 --- a/reactos/lib/rtl/CMakeLists.txt +++ b/reactos/lib/rtl/CMakeLists.txt @@ -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 diff --git a/reactos/lib/sdk/crt/CMakeLists.txt b/reactos/lib/sdk/crt/CMakeLists.txt index 2e0b24004f2..dd4a9d327d3 100644 --- a/reactos/lib/sdk/crt/CMakeLists.txt +++ b/reactos/lib/sdk/crt/CMakeLists.txt @@ -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() diff --git a/reactos/lib/sdk/crt/crt.cmake b/reactos/lib/sdk/crt/crt.cmake index f5f4b8e2e2c..05479fb94b5 100644 --- a/reactos/lib/sdk/crt/crt.cmake +++ b/reactos/lib/sdk/crt/crt.cmake @@ -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 diff --git a/reactos/lib/sdk/crt/libcntpr.cmake b/reactos/lib/sdk/crt/libcntpr.cmake index 7a5df849b11..b69636ec764 100644 --- a/reactos/lib/sdk/crt/libcntpr.cmake +++ b/reactos/lib/sdk/crt/libcntpr.cmake @@ -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 diff --git a/reactos/lib/sdk/crt/msvcrtex.cmake b/reactos/lib/sdk/crt/msvcrtex.cmake index fb99ca0700d..8351d2c2818 100644 --- a/reactos/lib/sdk/crt/msvcrtex.cmake +++ b/reactos/lib/sdk/crt/msvcrtex.cmake @@ -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) diff --git a/reactos/ntoskrnl/CMakeLists.txt b/reactos/ntoskrnl/CMakeLists.txt index 3242b9c7642..f888066d03d 100644 --- a/reactos/ntoskrnl/CMakeLists.txt +++ b/reactos/ntoskrnl/CMakeLists.txt @@ -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) diff --git a/reactos/subsystems/CMakeLists.txt b/reactos/subsystems/CMakeLists.txt index 9ae37a8221c..2b46b6d9308 100644 --- a/reactos/subsystems/CMakeLists.txt +++ b/reactos/subsystems/CMakeLists.txt @@ -1,4 +1,4 @@ -if(ARCH MATCHES i386) +if(ARCH STREQUAL "i386") add_subdirectory(ntvdm) endif() add_subdirectory(csr) diff --git a/reactos/toolchain-gcc.cmake b/reactos/toolchain-gcc.cmake index 094ee871387..a7d50685c22 100644 --- a/reactos/toolchain-gcc.cmake +++ b/reactos/toolchain-gcc.cmake @@ -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 " crs ") set(CMAKE_CXX_CREATE_STATIC_LIBRARY ${CMAKE_C_CREATE_STATIC_LIBRARY}) set(CMAKE_ASM_CREATE_STATIC_LIBRARY ${CMAKE_C_CREATE_STATIC_LIBRARY}) diff --git a/reactos/toolchain-msvc.cmake b/reactos/toolchain-msvc.cmake index c053a6ab0cf..3d692605fca 100644 --- a/reactos/toolchain-msvc.cmake +++ b/reactos/toolchain-msvc.cmake @@ -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() diff --git a/reactos/tools/rsym/CMakeLists.txt b/reactos/tools/rsym/CMakeLists.txt index fff410ad553..f6e5412fd71 100644 --- a/reactos/tools/rsym/CMakeLists.txt +++ b/reactos/tools/rsym/CMakeLists.txt @@ -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) diff --git a/reactos/win32ss/CMakeLists.txt b/reactos/win32ss/CMakeLists.txt index f66ef5b98c6..1986ce14fcf 100644 --- a/reactos/win32ss/CMakeLists.txt +++ b/reactos/win32ss/CMakeLists.txt @@ -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 diff --git a/reactos/win32ss/drivers/displays/framebuf_new/CMakeLists.txt b/reactos/win32ss/drivers/displays/framebuf_new/CMakeLists.txt index deafb6eb122..219829f10aa 100644 --- a/reactos/win32ss/drivers/displays/framebuf_new/CMakeLists.txt +++ b/reactos/win32ss/drivers/displays/framebuf_new/CMakeLists.txt @@ -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") diff --git a/reactos/win32ss/gdi/gdi32/CMakeLists.txt b/reactos/win32ss/gdi/gdi32/CMakeLists.txt index 1061717d5df..184f81f64cf 100644 --- a/reactos/win32ss/gdi/gdi32/CMakeLists.txt +++ b/reactos/win32ss/gdi/gdi32/CMakeLists.txt @@ -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()