summaryrefslogtreecommitdiff
path: root/indra/cmake/00-Common.cmake
diff options
context:
space:
mode:
authorSignal Linden <signal@lindenlab.com>2024-04-10 23:59:28 -0700
committerGitHub <noreply@github.com>2024-04-10 23:59:28 -0700
commitc86347eda085aa081dbff1ef12dc8a1c89314c21 (patch)
treefe34be3245c6157011396c0b1ef85f3ac614f923 /indra/cmake/00-Common.cmake
parent52f3f70ce887c0f8877de7a8439bf44a246e7f9a (diff)
parent148f80f0779f42c1aa7d2f07c04a63507446662c (diff)
Merge pull request #1196 from secondlife/signal/mold
Add LINK_WITH_MOLD option
Diffstat (limited to 'indra/cmake/00-Common.cmake')
-rw-r--r--indra/cmake/00-Common.cmake54
1 files changed, 34 insertions, 20 deletions
diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake
index d46ebc4960..21242a32be 100644
--- a/indra/cmake/00-Common.cmake
+++ b/indra/cmake/00-Common.cmake
@@ -15,6 +15,7 @@
include_guard()
include(Variables)
+include(Linker)
# We go to some trouble to set LL_BUILD to the set of relevant compiler flags.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} $ENV{LL_BUILD}")
@@ -127,23 +128,37 @@ if (LINUX)
APPID=secondlife
LL_IGNORE_SIGCHLD
)
+
add_compile_options(
- -fexceptions
- -fno-math-errno
- -fno-strict-aliasing
- -fsigned-char
- -msse2
- -mfpmath=sse
- -pthread
- -Wno-parentheses
- -Wno-deprecated
- -Wno-c++20-compat
- -Wno-pessimizing-move
- -Wno-stringop-overflow
- -Wno-stringop-truncation
- -Wno-dangling-pointer
- -fvisibility=hidden
+ -fexceptions
+ -fno-math-errno
+ -fno-strict-aliasing
+ -fsigned-char
+ -msse2
+ -mfpmath=sse
+ -pthread
+ -fvisibility=hidden
+ )
+
+ set(GCC_CLANG_COMPATIBLE_WARNINGS
+ -Wno-parentheses
+ -Wno-deprecated
+ -Wno-c++20-compat
+ -Wno-pessimizing-move
+ )
+
+ set(CLANG_WARNINGS
+ ${GCC_CLANG_COMPATIBLE_WARNINGS}
+ # Put clang specific warning configuration here
)
+
+ set(GCC_WARNINGS
+ ${GCC_CLANG_COMPATIBLE_WARNINGS}
+ -Wno-stringop-overflow
+ -Wno-stringop-truncation
+ -Wno-dangling-pointer
+ )
+
add_link_options(
-Wl,--no-keep-memory
-Wl,--build-id
@@ -156,12 +171,15 @@ if (LINUX)
# this stops us requiring a really recent glibc at runtime
add_compile_options(-fno-stack-protector)
- # ND: clang is a bit more picky than GCC, the latter seems to auto include -lstdc++ and -lm. The former not so and thus fails to link
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+ # ND: clang is a bit more picky than GCC, the latter seems to auto include -lstdc++ and -lm. The former not so and thus fails to link
add_link_options(
-lstdc++
-lm
)
+ add_compile_options(${CLANG_WARNINGS})
+ else()
+ add_compile_options(${GCC_WARNINGS})
endif()
endif (LINUX)
@@ -191,10 +209,6 @@ if (DARWIN)
list(APPEND GCC_WARNINGS -Wno-reorder -Wno-non-virtual-dtor )
- if(LINUX)
- list(APPEND GCC_WARNINGS -Wno-maybe-uninitialized -Wno-dangling-pointer )
- endif()
-
add_compile_options(${GCC_WARNINGS})
add_compile_options(-m${ADDRESS_SIZE})
endif ()