mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-06 21:00:17 +02:00
Merge pull request #5157 from crueter/mingw-builtin
[cmake] use `MINGW` builtin rather than custom detection
This commit is contained in:
12 files changed
+24
-28
No files matched your search
+8
-12
@@ -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()
|
||||
|
||||
Vendored
+1
-1
Submodule External/jemalloc updated: ce24593018...97d986993d.
@@ -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)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if (NOT MINGW_BUILD)
|
||||
if (NOT MINGW)
|
||||
add_subdirectory(Emitter/)
|
||||
add_subdirectory(APITests/)
|
||||
endif()
|
||||
@@ -6,6 +6,6 @@ add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-fno-strict-aliasing>)
|
||||
add_subdirectory(Common/)
|
||||
add_subdirectory(Tools/)
|
||||
|
||||
if (MINGW_BUILD)
|
||||
if (MINGW)
|
||||
add_subdirectory(Windows/)
|
||||
endif()
|
||||
@@ -11,7 +11,7 @@ set(SRCS
|
||||
VolatileMetadata.cpp
|
||||
)
|
||||
|
||||
if (NOT MINGW_BUILD)
|
||||
if (NOT MINGW)
|
||||
list (APPEND SRCS
|
||||
FEXServerClient.cpp
|
||||
FileFormatCheck.cpp)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -3,7 +3,7 @@ set(SRCS
|
||||
DummyHandlers.cpp
|
||||
)
|
||||
|
||||
if (NOT MINGW_BUILD)
|
||||
if (NOT MINGW)
|
||||
list(APPEND SRCS
|
||||
Linux/Utils/ELFContainer.cpp
|
||||
)
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if (NOT MINGW_BUILD)
|
||||
if (NOT MINGW)
|
||||
add_subdirectory(APITests/)
|
||||
add_subdirectory(POSIX/)
|
||||
add_subdirectory(gvisor-tests/)
|
||||
|
||||
Reference in new issue
Block a user