Suggestion for `cmake/compiler-specific.cmake` - allow user to override 
CFLAGS/LDFLAGS:

```
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")

  if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
    target_compile_definitions(common INTERFACE CC_GCC_LIKE_ASM)

    if(NOT DEFINED ENV{CFLAGS})
      target_compile_options(
        common INTERFACE -O0
                         # <$<$<BOOL:${PROFILE}>:-pg>
      )

      target_compile_options(
        common
        INTERFACE -Wall -funroll-loops -Wcast-align
                  -Werror=implicit-function-declaration -Werror=implicit-int
      )

      # If GCC version is greater than 4.2.0, enable the following flags
      if(CMAKE_C_COMPILER_VERSION VERSION_GREATER 4.2.0)
        target_compile_options(
          common INTERFACE -m64 -minline-all-stringops -falign-loops
                           -ftree-vectorize -fno-strict-overflow -mtune=generic
        )
      endif()
    endif()
  elseif(CMAKE_C_COMPILER_ID STREQUAL "Clang")
    target_compile_definitions(common INTERFACE CC_GCC_LIKE_ASM)
    if(NOT DEFINED ENV{CFLAGS})
      target_compile_options(common INTERFACE -m64)
    endif()
    if(NOT DEFINED ENV{LDFLAGS})
      target_link_options(common INTERFACE -m64)
    endif()
  endif()

# etc etc

```

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4082#issuecomment-2557930510
You are receiving this because you are subscribed to this thread.

Message ID: <kamailio/kamailio/issues/4082/2557930...@github.com>
_______________________________________________
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to