From 6809f379cd97bdeeabee1813aafc2e10ec783eeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Hrdli=C4=8Dka?= Date: Fri, 17 Dec 2021 07:47:24 +0100 Subject: [PATCH] Remove unneeded build actions; fix some comments --- CMakeLists.txt | 19 ------------------- src/CMakeLists.txt | 20 +++++++++----------- 2 files changed, 9 insertions(+), 30 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 69c7134da..0d73aaea8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4bdb5a15a..0c2f9d4e5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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 $ CONFIGURATIONS Debug RelWithDebInfo