Remove custom winebuild task (#8077)
Remove custom winebuild task; leverage wine 10.14+ directly instead --------- Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>
This commit is contained in:
@@ -11,6 +11,8 @@
|
||||
# WINE_32_FLAGS - 32-bit linker flags
|
||||
# WINE_64_LIBRARY_DIRS - Path(s) to 64-bit wine libs
|
||||
# WINE_64_FLAGS - 64-bit linker flags
|
||||
# WINE_VERSION - Wine version
|
||||
# WINE_ASLR_ENABLED - If binaries will use dynamicbase/ASLR; influenced by wine version and WINE_WANT_ASLR
|
||||
#
|
||||
|
||||
MACRO(_findwine_find_flags output expression result)
|
||||
@@ -69,7 +71,33 @@ FIND_PROGRAM(WINE_GCC NAMES
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
FIND_PROGRAM(WINE NAMES wine PATHS ${WINE_CXX_LOCATIONS} NO_DEFAULT_PATH)
|
||||
FIND_PROGRAM(WINE_BUILD NAMES winebuild PATHS ${WINE_CXX_LOCATIONS} NO_DEFAULT_PATH)
|
||||
|
||||
# Detect wine version
|
||||
if(WINE)
|
||||
# Wine version can be formatted:
|
||||
# wine-1.4
|
||||
# wine-6.0.3 (Ubuntu 6.0.3~repack-1)
|
||||
# wine-9.8 (Staging)
|
||||
# wine-9.22
|
||||
execute_process(COMMAND "${WINE}" --version OUTPUT_VARIABLE WINE_VERSION_OUTPUT ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
string(REGEX REPLACE "^wine-([^\ \t]+).*$" "\\1" WINE_VERSION "${WINE_VERSION_OUTPUT}")
|
||||
if(WINE_VERSION VERSION_LESS 8.17)
|
||||
# Wine versions prior to 8.17 did not use ASLR by default. Assume off.
|
||||
set(WINE_ASLR_ENABLED false)
|
||||
elseif(WINE_VERSION VERSION_GREATER_EQUAL 10.14 AND NOT WINE_WANT_ASLR)
|
||||
# Wine 10.14 introduced the ability to disable ASLR, preventing crashes with older VSTs (See issue #7987)
|
||||
# Explicitly set '/DYNAMICBASE:NO' per #7987 (effectively setting '/HIGHENTROPYVA:NO' as well for 64-bit)
|
||||
set(WINE_32_FLAGS "-Wb,--disable-dynamicbase")
|
||||
set(WINE_64_FLAGS "-Wb,--disable-dynamicbase")
|
||||
set(WINE_ASLR_ENABLED false)
|
||||
else()
|
||||
# Wine versions 8.17 - 10.13 use ASLR by default, but provide no option to disable. Assume on.
|
||||
set(WINE_ASLR_ENABLED true)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Detect wine paths and handle linking problems
|
||||
IF(WINE_CXX)
|
||||
# call wineg++ to obtain implied includes and libs
|
||||
@@ -149,13 +177,13 @@ mark_as_advanced(WINE_INCLUDE_DIR WINE_LIBRARY WINE_CXX WINE_BUILD)
|
||||
IF(WINE_32_LIBRARY_DIR)
|
||||
IF(WINE_32_LIBRARY_DIR MATCHES "^/opt/wine-.*")
|
||||
# winehq uses a singular lib directory
|
||||
SET(WINE_32_FLAGS "-L${WINE_32_LIBRARY_DIR}")
|
||||
SET(WINE_32_FLAGS "-L${WINE_32_LIBRARY_DIR} ${WINE_32_FLAGS}")
|
||||
SET(WINE_32_LIBRARY_DIRS "${WINE_32_LIBRARY_DIR}")
|
||||
ELSEIF(WINE_32_LIBRARY_DIR MATCHES "wine*/lib")
|
||||
SET(WINE_32_FLAGS "-L${WINE_32_LIBRARY_DIR} -L${WINE_32_LIBRARY_DIR}../")
|
||||
SET(WINE_32_FLAGS "-L${WINE_32_LIBRARY_DIR} -L${WINE_32_LIBRARY_DIR}../ ${WINE_32_FLAGS}")
|
||||
SET(WINE_32_LIBRARY_DIRS "${WINE_32_LIBRARY_DIR}:${WINE_32_LIBRARY_DIR}/..")
|
||||
ELSE()
|
||||
SET(WINE_32_FLAGS "-L${WINE_32_LIBRARY_DIR} -L${WINE_32_LIBRARY_DIR}wine/")
|
||||
SET(WINE_32_FLAGS "-L${WINE_32_LIBRARY_DIR} -L${WINE_32_LIBRARY_DIR}wine/ ${WINE_32_FLAGS}")
|
||||
SET(WINE_32_LIBRARY_DIRS "${WINE_32_LIBRARY_DIR}:${WINE_32_LIBRARY_DIR}wine/")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
@@ -163,13 +191,13 @@ ENDIF()
|
||||
IF(WINE_64_LIBRARY_DIR)
|
||||
IF(WINE_32_LIBRARY_DIR MATCHES "^/opt/wine-.*")
|
||||
# winehq uses a singular lib directory
|
||||
SET(WINE_64_FLAGS "-L${WINE_64_LIBRARY_DIR}")
|
||||
SET(WINE_64_FLAGS "-L${WINE_64_LIBRARY_DIR} ${WINE_64_FLAGS}")
|
||||
SET(WINE_64_LIBRARY_DIRS "${WINE_64_LIBRARY_DIR}")
|
||||
ELSEIF(WINE_64_LIBRARY_DIR MATCHES "wine*/lib")
|
||||
SET(WINE_64_FLAGS "-L${WINE_64_LIBRARY_DIR} -L${WINE_64_LIBRARY_DIR}../")
|
||||
SET(WINE_64_FLAGS "-L${WINE_64_LIBRARY_DIR} -L${WINE_64_LIBRARY_DIR}../ ${WINE_64_FLAGS}")
|
||||
SET(WINE_64_LIBRARY_DIRS "${WINE_64_LIBRARY_DIR}:${WINE_64_LIBRARY_DIR}/..")
|
||||
ELSE()
|
||||
SET(WINE_64_FLAGS "-L${WINE_64_LIBRARY_DIR} -L${WINE_64_LIBRARY_DIR}wine/")
|
||||
SET(WINE_64_FLAGS "-L${WINE_64_LIBRARY_DIR} -L${WINE_64_LIBRARY_DIR}wine/ ${WINE_64_FLAGS}")
|
||||
SET(WINE_64_LIBRARY_DIRS "${WINE_64_LIBRARY_DIR}:${WINE_64_LIBRARY_DIR}wine/")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
@@ -179,6 +207,8 @@ message(STATUS " WINE_CXX: ${WINE_CXX}")
|
||||
message(STATUS " WINE_GCC: ${WINE_GCC}")
|
||||
message(STATUS " WINE_32_FLAGS: ${WINE_32_FLAGS}")
|
||||
message(STATUS " WINE_64_FLAGS: ${WINE_64_FLAGS}")
|
||||
message(STATUS " WINE_VERSION: ${WINE_VERSION}")
|
||||
message(STATUS " WINE_ASLR_ENABLED: ${WINE_ASLR_ENABLED}")
|
||||
|
||||
# Create winegcc (technically, wineg++) wrapper
|
||||
configure_file(${CMAKE_CURRENT_LIST_DIR}/winegcc_wrapper.in winegcc_wrapper @ONLY)
|
||||
|
||||
Reference in New Issue
Block a user