CMake: Fix linker issues on Windows

Co-authored-by: Andrew Kaster <akaster@serenityos.org>
This commit is contained in:
Cameron Youell 2023-08-30 16:46:13 +10:00 committed by Andrew Kaster
parent 57f82c029c
commit c5219b0193
Notes: github-actions[bot] 2024-10-20 00:15:48 +00:00
3 changed files with 7 additions and 5 deletions

View file

@ -46,10 +46,12 @@ function(add_cxx_linker_flag_if_supported flag)
endif()
endfunction()
add_cxx_linker_flag_if_supported(LINKER:--gdb-index)
if (NOT WIN32)
add_cxx_linker_flag_if_supported(LINKER:--gdb-index)
if (NOT ENABLE_FUZZERS)
add_cxx_linker_flag_if_supported(LINKER:-Bsymbolic-non-weak-functions)
if (NOT ENABLE_FUZZERS)
add_cxx_linker_flag_if_supported(LINKER:-Bsymbolic-non-weak-functions)
endif()
endif()
if (ENABLE_LAGOM_COVERAGE_COLLECTION)

View file

@ -4,7 +4,7 @@
# SPDX-License-Identifier: BSD-2-Clause
#
if (NOT APPLE AND NOT ANDROID AND NOT LAGOM_USE_LINKER)
if (NOT APPLE AND NOT ANDROID AND NOT WIN32 AND NOT LAGOM_USE_LINKER)
find_program(LLD_LINKER NAMES "ld.lld")
if (LLD_LINKER)
message(STATUS "Using LLD to link Lagom.")

View file

@ -324,7 +324,7 @@ add_lagom_library_install_rules(JSClangPlugin)
# Create mostly empty targets for system libraries we don't need to build for Lagom
add_library(LibC INTERFACE)
add_library(LibCrypt INTERFACE)
if (NOT APPLE AND NOT ANDROID AND NOT EMSCRIPTEN AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD" AND NOT HAIKU)
if (NOT APPLE AND NOT ANDROID AND NOT EMSCRIPTEN AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD" AND NOT HAIKU AND NOT WIN32)
target_link_libraries(LibCrypt INTERFACE crypt) # LibCore::Account uses crypt() but it's not in libcrypt on macOS
endif()
add_library(NoCoverage INTERFACE)