Skip to content

Commit

Permalink
build: Silence MacOS linker/ar/ranlib warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonKagstrom committed Jun 30, 2024
1 parent bde2fa4 commit fb99788
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)


# Ignore some irritating warnings on MacOS
add_link_options(-Wl,-no_warn_duplicate_libraries)
# https://stackoverflow.com/questions/4929255/building-static-libraries-on-mac-using-cmake-and-gcc
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
set(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")

# Enable sanitizers in debug builds
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
add_compile_options(-fsanitize=address,undefined -g)
Expand Down

0 comments on commit fb99788

Please sign in to comment.