mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-11 16:46:16 +00:00
UPDATE: modify cmake scripts, adding warning messages.
This commit is contained in:
2
.gitmodules
vendored
2
.gitmodules
vendored
@@ -2,7 +2,7 @@
|
||||
path = deps/unicorn
|
||||
url = https://github.com/momo5502/unicorn.git
|
||||
shallow = true
|
||||
branch = a19ae94
|
||||
branch = wasm
|
||||
[submodule "deps/reflect"]
|
||||
path = deps/reflect
|
||||
url = https://github.com/qlibs/reflect.git
|
||||
|
||||
@@ -27,7 +27,18 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
# MinGW LTO will cause errors in compile stage
|
||||
# We just disable it
|
||||
if(CMAKE_C_COMPILER MATCHES "/.*/x86_64-w64-mingw32-gcc$")
|
||||
if(MINGW)
|
||||
set(MINGW_WARNING_SHOWED FALSE)
|
||||
if (NOT ${MINGW_WARNING_SHOWED})
|
||||
set(MINGW_WARNING_SHOWED TRUE)
|
||||
message(STATUS "!!!!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!!!!")
|
||||
message(STATUS "!!! Cross compile with MinGW is not fully tested !!!")
|
||||
message(STATUS "!!! Compile will continue after 10 seconds !!!")
|
||||
message(STATUS "!!! <CTRL-C> to stop compile. !!!")
|
||||
message(STATUS "!!! USE AT YOUR OWN RISK, YOU HAVE BEEN WARNED !!!")
|
||||
message(STATUS "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 10)
|
||||
endif()
|
||||
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION OFF)
|
||||
elseif(NOT CMAKE_SYSTEM_NAME MATCHES "Emscripten")
|
||||
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)
|
||||
|
||||
@@ -8,6 +8,9 @@ momo_add_subdirectory_and_get_targets("backends" BACKEND_TARGETS)
|
||||
momo_targets_set_folder("backends" ${BACKEND_TARGETS})
|
||||
|
||||
if (NOT MOMO_BUILD_AS_LIBRARY)
|
||||
if (MINGW)
|
||||
add_link_options(-static-libstdc++ -static -lwinpthread)
|
||||
endif()
|
||||
add_subdirectory(analyzer)
|
||||
add_subdirectory(debugger)
|
||||
add_subdirectory(fuzzing-engine)
|
||||
|
||||
@@ -14,10 +14,6 @@ if(NOT MOMO_ENABLE_CLANG_TIDY)
|
||||
target_precompile_headers(analyzer PRIVATE std_include.hpp)
|
||||
endif()
|
||||
|
||||
if(CMAKE_C_COMPILER MATCHES "/.*/x86_64-w64-mingw32-gcc$")
|
||||
target_link_options(analyzer PRIVATE -static-libstdc++ -static -lwinpthread)
|
||||
endif()
|
||||
|
||||
target_link_libraries(analyzer PRIVATE
|
||||
reflect
|
||||
debugger
|
||||
|
||||
@@ -16,9 +16,5 @@ endif()
|
||||
|
||||
target_include_directories(icicle-emulator INTERFACE "${CMAKE_CURRENT_LIST_DIR}")
|
||||
|
||||
if(CMAKE_C_COMPILER MATCHES "/.*/x86_64-w64-mingw32-gcc$")
|
||||
target_link_options(icicle-emulator PRIVATE -static-libstdc++ -static -lwinpthread)
|
||||
endif()
|
||||
|
||||
target_link_libraries(icicle-emulator PUBLIC emulator)
|
||||
target_link_libraries(icicle-emulator PRIVATE emulator-common icicle-bridge)
|
||||
|
||||
@@ -14,10 +14,6 @@ endif()
|
||||
|
||||
target_include_directories(unicorn-emulator INTERFACE "${CMAKE_CURRENT_LIST_DIR}")
|
||||
|
||||
if(CMAKE_C_COMPILER MATCHES "/.*/x86_64-w64-mingw32-gcc$")
|
||||
target_link_options(unicorn-emulator PRIVATE -static-libstdc++ -static -lwinpthread)
|
||||
endif()
|
||||
|
||||
target_link_libraries(unicorn-emulator PUBLIC emulator)
|
||||
target_link_libraries(unicorn-emulator PRIVATE unicorn emulator-common)
|
||||
|
||||
|
||||
@@ -12,15 +12,13 @@ target_include_directories(emulator-common INTERFACE "${CMAKE_CURRENT_LIST_DIR}"
|
||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
if(CMAKE_C_COMPILER MATCHES "/.*/x86_64-w64-mingw32-gcc$")
|
||||
target_link_libraries(emulator-common PUBLIC
|
||||
Threads::Threads
|
||||
zlibstatic
|
||||
)
|
||||
|
||||
if(MINGW)
|
||||
target_link_libraries(emulator-common PUBLIC
|
||||
Threads::Threads
|
||||
zlibstatic
|
||||
ws2_32
|
||||
)
|
||||
else()
|
||||
target_link_libraries(emulator-common PUBLIC
|
||||
Threads::Threads
|
||||
zlibstatic
|
||||
)
|
||||
endif()
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#ifdef __MINGW64__
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
#include <stdint.h>
|
||||
#include <cstdint>
|
||||
#else
|
||||
#include <WinSock2.h>
|
||||
#include <WS2tcpip.h>
|
||||
|
||||
@@ -14,10 +14,6 @@ if(NOT MOMO_ENABLE_CLANG_TIDY)
|
||||
target_precompile_headers(fuzzer PRIVATE std_include.hpp)
|
||||
endif()
|
||||
|
||||
if(CMAKE_C_COMPILER MATCHES "/.*/x86_64-w64-mingw32-gcc$")
|
||||
target_link_options(fuzzer PRIVATE -static-libstdc++ -static -lwinpthread)
|
||||
endif()
|
||||
|
||||
target_link_libraries(fuzzer PRIVATE
|
||||
fuzzing-engine
|
||||
windows-emulator
|
||||
|
||||
@@ -8,8 +8,7 @@ list(SORT SRC_FILES)
|
||||
|
||||
add_executable(test-sample ${SRC_FILES})
|
||||
|
||||
if(CMAKE_C_COMPILER MATCHES "/.*/x86_64-w64-mingw32-gcc$")
|
||||
target_link_options(test-sample PRIVATE -static-libstdc++ -static -lwinpthread)
|
||||
if(MINGW)
|
||||
target_link_libraries(test-sample PRIVATE ws2_32)
|
||||
endif()
|
||||
|
||||
|
||||
@@ -10,10 +10,6 @@ add_executable(dump-apiset ${SRC_FILES})
|
||||
|
||||
momo_assign_source_group(${SRC_FILES})
|
||||
|
||||
if(CMAKE_C_COMPILER MATCHES "/.*/x86_64-w64-mingw32-gcc$")
|
||||
target_link_options(dump-apiset PRIVATE -static-libstdc++ -static -lwinpthread)
|
||||
endif()
|
||||
|
||||
target_link_libraries(dump-apiset PRIVATE
|
||||
emulator-common
|
||||
)
|
||||
|
||||
@@ -10,14 +10,6 @@ add_executable(windows-emulator-test ${SRC_FILES})
|
||||
|
||||
momo_assign_source_group(${SRC_FILES})
|
||||
|
||||
if(CMAKE_C_COMPILER MATCHES "/.*/x86_64-w64-mingw32-gcc$")
|
||||
target_link_options(windows-emulator-test PRIVATE -static-libstdc++ -static -lwinpthread)
|
||||
endif()
|
||||
|
||||
if(CMAKE_C_COMPILER MATCHES "/.*/x86_64-w64-mingw32-gcc$")
|
||||
target_link_options(windows-emulator-test PRIVATE -static-libstdc++ -static -lwinpthread)
|
||||
endif()
|
||||
|
||||
target_link_libraries(windows-emulator-test PRIVATE
|
||||
gtest
|
||||
gtest_main
|
||||
|
||||
Reference in New Issue
Block a user