diff --git a/CMakeLists.txt b/CMakeLists.txt index 6c2e4bddb..24acf28a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,15 +49,11 @@ if (NOT HOSTLIBS_DATA_DIRECTORY) set(HOSTLIBS_DATA_DIRECTORY "${CMAKE_INSTALL_FULL_LIBDIR}/fex-emu") endif() -string(FIND ${CMAKE_BASE_NAME} mingw CONTAINS_MINGW) -if (NOT CONTAINS_MINGW EQUAL -1) - message (STATUS "Mingw build") - set (MINGW_BUILD TRUE) +if (MINGW) + message (STATUS "Building for MinGW") set (ENABLE_JEMALLOC TRUE) set (ENABLE_JEMALLOC_GLIBC_ALLOC FALSE) -endif() - -if (NOT MINGW_BUILD) +else () message (STATUS "Clang version ${CMAKE_CXX_COMPILER_VERSION}") set (CLANG_MINIMUM_VERSION 13.0) if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${CLANG_MINIMUM_VERSION}) @@ -88,7 +84,7 @@ if (ENABLE_FEXCORE_PROFILER) add_definitions(-DTRACY_NO_SAMPLING=1) # This pulls in libbacktrace which allocators in global constructors (before FEX can set up its allocator hooks) add_definitions(-DTRACY_NO_CALLSTACK=1) - if (MINGW_BUILD) + if (MINGW) message(FATAL_ERROR "Tracy profiler not supported") endif() else() @@ -188,7 +184,7 @@ check_cxx_source_compiles( HAS_CLANG_PRESERVE_ALL) unset(CMAKE_REQUIRED_FLAGS) if (HAS_CLANG_PRESERVE_ALL) - if (MINGW_BUILD) + if (MINGW) message(STATUS "Ignoring broken clang::preserve_all support") set(HAS_CLANG_PRESERVE_ALL FALSE) else() @@ -277,7 +273,7 @@ if (ENABLE_JEMALLOC_GLIBC_ALLOC) # Required for thunks to work. # All host native libraries will use this allocator, while *most* other FEX internal allocations will use the other jemalloc allocator. add_subdirectory(External/jemalloc_glibc/) -elseif (NOT MINGW_BUILD) +elseif (NOT MINGW) message (STATUS " jemalloc glibc allocator disabled!\n" " This is not a recommended configuration!\n" @@ -288,7 +284,7 @@ endif() if (ENABLE_JEMALLOC) # The jemalloc subproject that all FEXCore fextl objects allocate through. add_subdirectory(External/jemalloc/) -elseif (NOT MINGW_BUILD) +elseif (NOT MINGW) message (STATUS " jemalloc disabled!\n" " This is not a recommended configuration!\n" @@ -518,7 +514,7 @@ add_subdirectory(FEXHeaderUtils/) add_subdirectory(CodeEmitter/) add_subdirectory(FEXCore/) -if (_M_ARM_64 AND NOT MINGW_BUILD AND NOT BUILD_STEAM_SUPPORT) +if (_M_ARM_64 AND NOT MINGW AND NOT BUILD_STEAM_SUPPORT) # Binfmt_misc files must be installed prior to Source/ installs add_subdirectory(Data/binfmts/) endif() diff --git a/External/jemalloc b/External/jemalloc index ce2459301..97d986993 160000 --- a/External/jemalloc +++ b/External/jemalloc @@ -1 +1 @@ -Subproject commit ce24593018ca5d5af7e5661ceda9744e02b59f8f +Subproject commit 97d986993dc735a2022856e7e9fdfa1180e8527a diff --git a/FEXCore/Source/CMakeLists.txt b/FEXCore/Source/CMakeLists.txt index de1de9bde..52441be3b 100644 --- a/FEXCore/Source/CMakeLists.txt +++ b/FEXCore/Source/CMakeLists.txt @@ -9,7 +9,7 @@ set (FEXCORE_BASE_SRCS Utils/SpinWaitLock.cpp ) -if (NOT MINGW_BUILD) +if (NOT MINGW) list(APPEND FEXCORE_BASE_SRCS Utils/Allocator/64BitAllocator.cpp) endif() @@ -108,7 +108,7 @@ if (ENABLE_VIXL_DISASSEMBLER OR ENABLE_VIXL_SIMULATOR) list (APPEND LIBS vixl) endif() -if (NOT MINGW_BUILD) +if (NOT MINGW) list (APPEND LIBS dl) else() list (APPEND LIBS synchronization) @@ -291,7 +291,7 @@ AddObject(${PROJECT_NAME}_object OBJECT) AddLibrary(${PROJECT_NAME} STATIC) AddLibrary(${PROJECT_NAME}_shared SHARED) -if (NOT MINGW_BUILD AND NOT BUILD_STEAM_SUPPORT) +if (NOT MINGW AND NOT BUILD_STEAM_SUPPORT) install(TARGETS ${PROJECT_NAME}_shared LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} @@ -310,7 +310,7 @@ if (ENABLE_JEMALLOC_GLIBC_ALLOC) target_link_libraries(JemallocLibs INTERFACE FEX_jemalloc_glibc) endif() -if (NOT MINGW_BUILD) +if (NOT MINGW) # Dummy project to use for host tools. # This overrides use of jemalloc in FEXCore with the normal glibc allocator. add_library(JemallocDummy STATIC Utils/AllocatorHooks.cpp) diff --git a/FEXCore/unittests/CMakeLists.txt b/FEXCore/unittests/CMakeLists.txt index 99bcda907..6e3c9e8b6 100644 --- a/FEXCore/unittests/CMakeLists.txt +++ b/FEXCore/unittests/CMakeLists.txt @@ -1,4 +1,4 @@ -if (NOT MINGW_BUILD) +if (NOT MINGW) add_subdirectory(Emitter/) add_subdirectory(APITests/) endif() diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 6f4c828b2..ab9a76716 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -6,6 +6,6 @@ add_compile_options($<$:-fno-strict-aliasing>) add_subdirectory(Common/) add_subdirectory(Tools/) -if (MINGW_BUILD) +if (MINGW) add_subdirectory(Windows/) endif() diff --git a/Source/Common/CMakeLists.txt b/Source/Common/CMakeLists.txt index ec908fef9..ea0c064dd 100644 --- a/Source/Common/CMakeLists.txt +++ b/Source/Common/CMakeLists.txt @@ -11,7 +11,7 @@ set(SRCS VolatileMetadata.cpp ) -if (NOT MINGW_BUILD) +if (NOT MINGW) list (APPEND SRCS FEXServerClient.cpp FileFormatCheck.cpp) diff --git a/Source/Tools/CMakeLists.txt b/Source/Tools/CMakeLists.txt index b6efc45ab..4e4320f80 100644 --- a/Source/Tools/CMakeLists.txt +++ b/Source/Tools/CMakeLists.txt @@ -1,6 +1,6 @@ add_subdirectory(CommonTools) -if (NOT MINGW_BUILD) +if (NOT MINGW) if (BUILD_FEXCONFIG) find_package(Qt6 COMPONENTS Qml Quick Widgets QUIET) if (NOT Qt6_FOUND) diff --git a/Source/Tools/CommonTools/CMakeLists.txt b/Source/Tools/CommonTools/CMakeLists.txt index 451f0a5b4..b670f7c61 100644 --- a/Source/Tools/CommonTools/CMakeLists.txt +++ b/Source/Tools/CommonTools/CMakeLists.txt @@ -3,7 +3,7 @@ set(SRCS DummyHandlers.cpp ) -if (NOT MINGW_BUILD) +if (NOT MINGW) list(APPEND SRCS Linux/Utils/ELFContainer.cpp ) diff --git a/Source/Tools/TestHarnessRunner/CMakeLists.txt b/Source/Tools/TestHarnessRunner/CMakeLists.txt index 34d9a159b..6fdbc5bb7 100644 --- a/Source/Tools/TestHarnessRunner/CMakeLists.txt +++ b/Source/Tools/TestHarnessRunner/CMakeLists.txt @@ -1,7 +1,7 @@ list(APPEND LIBS FEXCore Common JemallocLibs) set (SRCS TestHarnessRunner.cpp) -if (NOT MINGW_BUILD) +if (NOT MINGW) list(APPEND SRCS TestHarnessRunner/HostRunner.cpp) list(APPEND LIBS LinuxEmulation CommonTools) endif() diff --git a/unittests/32Bit_ASM/CMakeLists.txt b/unittests/32Bit_ASM/CMakeLists.txt index 187a5a675..1469faa0b 100644 --- a/unittests/32Bit_ASM/CMakeLists.txt +++ b/unittests/32Bit_ASM/CMakeLists.txt @@ -65,7 +65,7 @@ foreach(ASM_SRC ${ASM_SOURCES}) ) endif() - if (NOT MINGW_BUILD) + if (NOT MINGW) set (LAUNCH_PROGRAM "${CMAKE_BINARY_DIR}/Bin/TestHarnessRunner") else() set (LAUNCH_PROGRAM "wine" "${CMAKE_BINARY_DIR}/Bin/TestHarnessRunner.exe") @@ -102,7 +102,7 @@ foreach(ASM_SRC ${ASM_SOURCES}) set_property(TEST ${TEST_NAME} APPEND PROPERTY DEPENDS "${OUTPUT_CONFIG_NAME}") set_property(TEST ${TEST_NAME} APPEND PROPERTY SKIP_RETURN_CODE 125) set_property(TEST ${TEST_NAME} APPEND PROPERTY ENVIRONMENT ${FEX_ARGS_LIST}) - if (MINGW_BUILD) + if (MINGW) # Ensure the DOS region can be allocated. set_property(TEST ${TEST_NAME} APPEND PROPERTY ENVIRONMENT "WINEPRELOADRESERVE=10000-110000") endif() diff --git a/unittests/ASM/CMakeLists.txt b/unittests/ASM/CMakeLists.txt index ac0047647..0680d833d 100644 --- a/unittests/ASM/CMakeLists.txt +++ b/unittests/ASM/CMakeLists.txt @@ -67,7 +67,7 @@ foreach(ASM_SRC ${ASM_SOURCES}) ) endif() - if (NOT MINGW_BUILD) + if (NOT MINGW) set (LAUNCH_PROGRAM "${CMAKE_BINARY_DIR}/Bin/TestHarnessRunner") else() set (LAUNCH_PROGRAM "wine" "${CMAKE_BINARY_DIR}/Bin/TestHarnessRunner.exe") @@ -109,7 +109,7 @@ foreach(ASM_SRC ${ASM_SOURCES}) set_property(TEST ${TEST_NAME} APPEND PROPERTY DEPENDS "${OUTPUT_CONFIG_NAME}") set_property(TEST ${TEST_NAME} APPEND PROPERTY SKIP_RETURN_CODE 125) set_property(TEST ${TEST_NAME} APPEND PROPERTY ENVIRONMENT ${FEX_ARGS_LIST}) - if (MINGW_BUILD) + if (MINGW) # Ensure the DOS region can be allocated. set_property(TEST ${TEST_NAME} APPEND PROPERTY ENVIRONMENT "WINEPRELOADRESERVE=10000-110000") endif() diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt index be7cc55e1..4dacdc6da 100644 --- a/unittests/CMakeLists.txt +++ b/unittests/CMakeLists.txt @@ -1,4 +1,4 @@ -if (NOT MINGW_BUILD) +if (NOT MINGW) add_subdirectory(APITests/) add_subdirectory(POSIX/) add_subdirectory(gvisor-tests/)