Remove unneeded build actions; fix some comments

This commit is contained in:
David Hrdlička 2021-12-17 07:47:24 +01:00
parent 38fddca97a
commit 6809f379cd
2 changed files with 9 additions and 30 deletions

View file

@ -130,23 +130,4 @@ if(NOT EMU_COPYRIGHT_YEAR)
set(EMU_COPYRIGHT_YEAR 2021)
endif()
# HACK: Avoid a MSVC2019 compiler bug on ARM64 Debug builds
if(MSVC_TOOLSET_VERSION GREATER_EQUAL 142 AND ARCH STREQUAL "arm64")
# Define a cache option in case somebody wants to disable this workaround
set(AVOID_LNK1322 ON CACHE BOOL "Prevent LNK1322 on MSVC2019 ARM64 debug builds")
if(AVOID_LNK1322)
message(STATUS "Working around LNK1322 (86Box#1268)")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /Gy")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Gy")
endif()
endif()
# HACK: MinGW and macOS <10.15 does not have `timespec_get`
include(CheckSymbolExists)
check_symbol_exists(timespec_get time.h HAS_TIMESPEC_GET)
if(HAS_TIMESPEC_GET)
add_compile_definitions(HAS_TIMESPEC_GET)
endif()
add_subdirectory(src)

View file

@ -69,7 +69,6 @@ if(MINGW)
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a" ".dll.a")
endif()
#some macOS specific configuration steps
if(APPLE)
# Force using the newest library if it's installed by homebrew
set(CMAKE_FIND_FRAMEWORK LAST)
@ -81,7 +80,9 @@ endif()
find_package(Freetype REQUIRED)
include_directories(${FREETYPE_INCLUDE_DIRS})
if(APPLE)
target_link_libraries(86Box Freetype::Freetype) # bundles freetype for the macOS app bundle
# Freetype is dynamically loaded by the emulator, however, we link it
# on macOS so it gets copied to the bundle by the installation process
target_link_libraries(86Box Freetype::Freetype)
endif()
find_package(OpenAL REQUIRED)
@ -90,17 +91,13 @@ target_link_libraries(86Box ${OPENAL_LIBRARY})
find_package(SDL2 REQUIRED)
include_directories(${SDL2_INCLUDE_DIRS})
if(MINGW)
if(WIN32 AND TARGET SDL2::SDL2-static)
target_link_libraries(86Box SDL2::SDL2-static)
elseif(WIN32)
target_link_libraries(86Box SDL2::SDL2)
else()
if (TARGET SDL2::SDL2)
elseif(TARGET SDL2::SDL2)
target_link_libraries(86Box SDL2::SDL2)
else()
target_link_libraries(86Box ${SDL2_LIBRARIES})
endif()
endif()
find_package(PNG REQUIRED)
include_directories(${PNG_INCLUDE_DIRS})
@ -147,15 +144,14 @@ if(MINITRACE)
endif()
if(APPLE)
# `install` fails on Mac if the destination is omitted
install(TARGETS 86Box DESTINATION "bin")
else()
install(TARGETS 86Box)
endif()
# adjustments for macOS app bundles
# Install our dependencies to the macOS bundle
if(APPLE)
set(APPS ${CMAKE_CURRENT_BINARY_DIR}/86Box.app)
install(CODE "
include(BundleUtilities)
get_filename_component(CMAKE_INSTALL_PREFIX_ABSOLUTE \${CMAKE_INSTALL_PREFIX} ABSOLUTE)
@ -163,10 +159,12 @@ if(APPLE)
COMPONENT Runtime)
endif()
# Install our dependencies if using vcpkg
if(VCPKG_TOOLCHAIN)
x_vcpkg_install_local_dependencies(TARGETS 86Box DESTINATION "bin")
endif()
# Install the PDB file on MSVC builds (i.e. LLVM on Windows+vcpkg)
if(MSVC)
install(FILES $<TARGET_PDB_FILE:86Box>
CONFIGURATIONS Debug RelWithDebInfo