Skip to content

Commit

Permalink
Fix some Wine detection errors
Browse files Browse the repository at this point in the history
  • Loading branch information
PhysSong authored and IanCaio committed Mar 28, 2021
1 parent 7ccbec3 commit ea4bac2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 18 deletions.
23 changes: 8 additions & 15 deletions cmake/modules/FindWine.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#
# WINE_FOUND - System has wine
# WINE_INCLUDE_DIRS - The wine include directories
# WINE_LIBRARIES - The libraries needed to use wine
# WINE_DEFINITIONS - Compiler switches required for using wine
#

Expand Down Expand Up @@ -60,16 +59,16 @@ IF(WINE_CXX)
# WineHQ (/opt/wine-stable, /opt/wine-devel, /opt/wine-staging)
STRING(REGEX REPLACE "/lib64/wine/$" "/lib/wine/" WINE_32_LIBRARY_DIR "${WINE_32_LIBRARY_DIR}")
STRING(REGEX REPLACE "/lib/wine/$" "/lib64/wine/" WINE_64_LIBRARY_DIR "${WINE_64_LIBRARY_DIR}")
ELSEIF(WINE_32_LIBRARY_DIR MATCHES "/lib32/.*/wine/")
ELSEIF(WINE_32_LIBRARY_DIR MATCHES "/lib32/")
# Systems with old multilib layout
STRING(REPLACE "/lib32/" "/lib/" WINE_64_LIBRARY_DIR "${WINE_32_LIBRARY_DIR}")
ELSEIF(WINE_32_LIBRARY_DIR MATCHES "/lib64/.*/wine/")
ELSEIF(WINE_32_LIBRARY_DIR MATCHES "/lib64/")
# We need to test if the corresponding 64bit library directory is lib or lib32
STRING(REPLACE "/lib64/" "/lib32/" WINE_32_LIBRARY_DIR "${WINE_64_LIBRARY_DIR}")
IF(NOT EXISTS "${WINE_32_LIBRARY_DIR}")
STRING(REPLACE "/lib64/" "/lib/" WINE_32_LIBRARY_DIR "${WINE_64_LIBRARY_DIR}")
ENDIF()
ELSEIF(WINE_32_LIBRARY_DIR MATCHES "/lib/.*/wine/")
ELSEIF(WINE_32_LIBRARY_DIR MATCHES "/lib/")
# Test if this directory is for 32bit or 64bit
STRING(REPLACE "/lib/" "/lib32/" WINE_32_LIBRARY_DIR "${WINE_64_LIBRARY_DIR}")
IF(NOT EXISTS "${WINE_32_LIBRARY_DIR}")
Expand All @@ -89,18 +88,12 @@ FIND_PATH(WINE_INCLUDE_DIR wine/exception.h

SET(_ARCHITECTURE ${CMAKE_LIBRARY_ARCHITECTURE})

FIND_LIBRARY(WINE_LIBRARY NAMES wine
PATH_SUFFIXES wine i386-linux-gnu/wine
HINTS "${WINE_32_LIBRARY_DIR}" "${WINE_64_LIBRARY_DIR}"
)

SET(CMAKE_LIBRARY_ARCHITECTURE ${_ARCHITECTURE})

SET(WINE_INCLUDE_DIRS ${WINE_INCLUDE_DIR} )
SET(WINE_LIBRARIES ${WINE_LIBRARY})

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Wine DEFAULT_MSG WINE_CXX WINE_LIBRARIES WINE_INCLUDE_DIRS)
find_package_handle_standard_args(Wine DEFAULT_MSG WINE_CXX WINE_INCLUDE_DIRS)

mark_as_advanced(WINE_INCLUDE_DIR WINE_LIBRARY WINE_CXX WINE_BUILD)

Expand All @@ -109,8 +102,8 @@ IF(WINE_32_LIBRARY_DIR)
SET(WINE_32_FLAGS "-L${WINE_32_LIBRARY_DIR} -L${WINE_32_LIBRARY_DIR}../")
SET(WINE_32_LIBRARY_DIRS "${WINE_32_LIBRARY_DIR}:${WINE_32_LIBRARY_DIR}/..")
ELSE()
SET(WINE_32_FLAGS "-L${WINE_32_LIBRARY_DIR}")
SET(WINE_32_LIBRARY_DIRS "${WINE_32_LIBRARY_DIR}")
SET(WINE_32_FLAGS "-L${WINE_32_LIBRARY_DIR} -L${WINE_32_LIBRARY_DIR}wine/")
SET(WINE_32_LIBRARY_DIRS "${WINE_32_LIBRARY_DIR}:${WINE_32_LIBRARY_DIR}wine/")
ENDIF()
ENDIF()

Expand All @@ -119,8 +112,8 @@ IF(WINE_64_LIBRARY_DIR)
SET(WINE_64_FLAGS "-L${WINE_64_LIBRARY_DIR} -L${WINE_64_LIBRARY_DIR}../")
SET(WINE_64_LIBRARY_DIRS "${WINE_64_LIBRARY_DIR}:${WINE_64_LIBRARY_DIR}/..")
ELSE()
SET(WINE_64_FLAGS "-L${WINE_64_LIBRARY_DIR}")
SET(WINE_64_LIBRARY_DIRS "${WINE_64_LIBRARY_DIR}")
SET(WINE_64_FLAGS "-L${WINE_64_LIBRARY_DIR} -L${WINE_64_LIBRARY_DIR}wine/")
SET(WINE_64_LIBRARY_DIRS "${WINE_64_LIBRARY_DIR}:${WINE_64_LIBRARY_DIR}wine/")
ENDIF()
ENDIF()

Expand Down
2 changes: 1 addition & 1 deletion src/3rdparty/weakjack/weakjack

0 comments on commit ea4bac2

Please sign in to comment.