From 142dbc0aca8268b31f94e36a73228850764954cc Mon Sep 17 00:00:00 2001 From: Rafael Kitover Date: Sun, 10 Sep 2017 12:24:36 -0700 Subject: [PATCH] cmake: use arch specific minhook trampoline libs Use either the 32 bit or 64 bit MinHook trampoline static lib for the Wx ABI tests, depending on the detected arch of the host/target. --- dependencies | 2 +- src/wx/CMakeLists.txt | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/dependencies b/dependencies index aa2499de..f5e2e826 160000 --- a/dependencies +++ b/dependencies @@ -1 +1 @@ -Subproject commit aa2499de8fdf2f804c4ed624b4d8f17c1e304fb0 +Subproject commit f5e2e826ea52bb040b6a0da0e53c26b441de79f8 diff --git a/src/wx/CMakeLists.txt b/src/wx/CMakeLists.txt index 08945682..7dd13744 100644 --- a/src/wx/CMakeLists.txt +++ b/src/wx/CMakeLists.txt @@ -190,7 +190,15 @@ int main(int argc, char** argv) # on windows we need the trampoline library from dependencies IF(WIN32) SET(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} -w -fpermissive "-I${CMAKE_SOURCE_DIR}/dependencies/minhook/include") - SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} -Wl,--subsystem,console "${CMAKE_SOURCE_DIR}/dependencies/minhook/libMinHook.a") + SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} -Wl,--subsystem,console) + + IF(X86_32) + SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} "${CMAKE_SOURCE_DIR}/dependencies/minhook/libMinHook.a") + ELSEIF(AMD64) + SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} "${CMAKE_SOURCE_DIR}/dependencies/minhook/libMinHook_64.a") + ELSE() + MESSAGE(FATAL_ERROR "Unknown Windows architecture target!") + ENDIF() ENDIF() CHECK_CXX_SOURCE_RUNS("${WX_TEST_CONSOLE_APP}" WX_DEFAULT_ABI_VERSION_COMPATIBLE)