forked from hercules-390/decNumber-icu-368
-
Notifications
You must be signed in to change notification settings - Fork 6
/
cflags.txt
73 lines (52 loc) · 2.63 KB
/
cflags.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#------------------------------------------------------------------------------
# Adjust needed compile flags for this project/package
#------------------------------------------------------------------------------
include( CheckCCompilerFlag ) # Check compiler support for certain flags
include( targetver.txt ) # Define minimum required Windows platform
#------------------------------------------------------------------------------
if( WIN32 )
set( PKG_C_FLAGS "${PKG_C_FLAGS} -D _CRT_SECURE_NO_WARNINGS" )
endif()
#------------------------------------------------------------------------------
set( PKG_C_FLAGS "${PKG_C_FLAGS} -D DECPRINT=0" )
#------------------------------------------------------------------------------
set( PKG_C_FLAGS "${PKG_C_FLAGS} -D LITTLE_ENDIAN=1234" )
set( PKG_C_FLAGS "${PKG_C_FLAGS} -D BIG_ENDIAN=4321" )
if( IS_BIG_ENDIAN )
set( PKG_C_FLAGS "${PKG_C_FLAGS} -D BYTE_ORDER=BIG_ENDIAN" )
set( PKG_C_FLAGS "${PKG_C_FLAGS} -D DECLITEND=0" )
else()
set( PKG_C_FLAGS "${PKG_C_FLAGS} -D BYTE_ORDER=LITTLE_ENDIAN" )
set( PKG_C_FLAGS "${PKG_C_FLAGS} -D DECLITEND=1" )
endif()
#------------------------------------------------------------------------------
set( CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${PKG_C_FLAGS}" )
set( CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${PKG_C_FLAGS}" )
set( CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D HAVE_PLATFORM_H -D DEBUG" )
set( CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -D HAVE_PLATFORM_H" )
set( CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D VERS_STRING=${VERS_STRING}" )
set( CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -D VERS_STRING=${VERS_STRING}" )
#------------------------------------------------------------------------------
# Some compilers don't accept either of the '-m32' or '-m64' machine options
# when support only exists for building 32-bit binaries but not 64-bit (i.e.
# if 64-bit support hasn't been installed then neither flag is accepted).
#------------------------------------------------------------------------------
if( NOT WIN32 )
set( TEMP_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}" )
set( CMAKE_REQUIRED_FLAGS "-m32" )
Check_C_Compiler_Flag( -m32 OK )
if( OK )
set( m32 "-m32" )
else()
set( m32 "" )
endif()
set( CMAKE_REQUIRED_FLAGS "-m64" )
Check_C_Compiler_Flag( -m64 OK )
set( CMAKE_REQUIRED_FLAGS "${TEMP_CMAKE_REQUIRED_FLAGS}" )
if( OK )
set( m64 "-m64" )
else()
set( m64 "" )
endif()
endif()
#------------------------------------------------------------------------------