Pick up some compiler-specific flags from autotools.

Bug: 14554
Change-Id: Idf4585671ad2698bd51f65abadb1b1000ad56445
Reviewed-on: https://code.wireshark.org/review/26716
Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
Guy Harris 2018-04-02 13:21:39 -07:00
parent 2f18a32864
commit 29973ebeb6
1 changed files with 17 additions and 2 deletions

View File

@ -436,9 +436,24 @@ else() # ! MSVC
#
set(CMAKE_C_FLAGS "-qlanglvl=extc99 ${CMAKE_C_FLAGS}")
elseif(CMAKE_C_COMPILER_ID MATCHES "HP")
set(CMAKE_C_FLAGS "-AC99 ${CMAKE_C_FLAGS}")
#
# We also need to add -Wp,-H200000 to handle some large
# #defines we have; that flag is not necessary for the
# C++ compiler unless the "legacy" C++ preprocessor is
# being used (+legacy_cpp). We don't want the legacy
# preprocessor if it's not the default, so we just add
# -Wp,-H200000 to the C flags. (If there are older
# versions of aC++ that only support the legacy
# preprocessor, and require that we boost the table
# size, we'd have to check whether -Wp,-H200000 is
# supported by the C++ compiler and add it only if it is.)
#
set(CMAKE_C_FLAGS "-AC99 -Wp,-H200000 $WS_CFLAGS ${CMAKE_C_FLAGS}")
elseif(CMAKE_C_COMPILER_ID MATCHES "Sun")
set(CMAKE_C_FLAGS "-xc99 ${CMAKE_C_FLAGS}")
#
# We also crank up the warning level.
#
set(CMAKE_C_FLAGS "-xc99 -v ${CMAKE_C_FLAGS}")
elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
set(CMAKE_C_FLAGS "-c99 ${CMAKE_C_FLAGS}")
endif()