Skip to content

Commit b406bb2

Browse files
committed
Split common flags of GMMLIB_COMPILER_FLAGS_COMMON for multi architectures
1 parent af5f033 commit b406bb2

File tree

1 file changed

+26
-58
lines changed

1 file changed

+26
-58
lines changed

Source/GmmLib/Linux.cmake

Lines changed: 26 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -19,46 +19,8 @@
1919
# OTHER DEALINGS IN THE SOFTWARE.
2020

2121
#this file should contain only compiler and linker flags
22-
if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "^aarch")
23-
SET (GMMLIB_COMPILER_FLAGS_COMMON
24-
#general warnings
25-
#-Wall
26-
-Winit-self
27-
-Winvalid-pch
28-
-Wpointer-arith
29-
-Wno-unused
30-
-Wno-unknown-pragmas
31-
-Wno-comments
32-
-Wno-narrowing
33-
-Wno-overflow
34-
-Wno-parentheses
35-
-Wno-missing-braces
36-
-Wno-sign-compare
37-
-Werror=address
38-
-Werror=format-security
39-
-Werror=return-type
4022

41-
# General optimization options
42-
-march=${GMMLIB_MARCH}
43-
-finline-functions
44-
-fno-short-enums
45-
-Wa,--noexecstack
46-
-fno-strict-aliasing
47-
# Common defines
48-
-DUSE_NEON
49-
# Other common flags
50-
-fstack-protector
51-
-fdata-sections
52-
-ffunction-sections
53-
-fmessage-length=0
54-
-fvisibility=hidden
55-
-fPIC
56-
-g
57-
)
58-
else()
59-
SET (GMMLIB_COMPILER_FLAGS_COMMON
60-
#general warnings
61-
-Wall
23+
SET (GMMLIB_COMPILER_FLAGS_COMMON
6224
-Winit-self
6325
-Winvalid-pch
6426
-Wpointer-arith
@@ -70,32 +32,16 @@ else()
7032
-Wno-parentheses
7133
-Wno-missing-braces
7234
-Wno-sign-compare
73-
-Wno-enum-compare
7435
-Werror=address
7536
-Werror=format-security
7637
-Werror=return-type
7738

7839
# General optimization options
7940
-march=${GMMLIB_MARCH}
80-
-mpopcnt
81-
-msse
82-
-msse2
83-
-msse3
84-
-mssse3
85-
-msse4
86-
-msse4.1
87-
-msse4.2
88-
-mfpmath=sse
8941
-finline-functions
9042
-fno-short-enums
9143
-Wa,--noexecstack
9244
-fno-strict-aliasing
93-
# Common defines
94-
-DUSE_MMX
95-
-DUSE_SSE
96-
-DUSE_SSE2
97-
-DUSE_SSE3
98-
-DUSE_SSSE3
9945
# Other common flags
10046
-fstack-protector
10147
-fdata-sections
@@ -104,9 +50,31 @@ else()
10450
-fvisibility=hidden
10551
-fPIC
10652
-g
107-
# -m32 or -m64
108-
-m${GMMLIB_ARCH}
109-
)
53+
)
54+
55+
if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "^aarch")
56+
list(APPEND GMMLIB_COMPILER_FLAGS_COMMON "-DUSE_NEON")
57+
else()
58+
list (APPEND GMMLIB_COMPILER_FLAGS_COMMON
59+
-Wall
60+
-Wno-enum-compare
61+
-mpopcnt
62+
-msse
63+
-msse2
64+
-msse3
65+
-mssse3
66+
-msse4
67+
-msse4.1
68+
-msse4.2
69+
-mfpmath=sse
70+
-DUSE_MMX
71+
-DUSE_SSE
72+
-DUSE_SSE2
73+
-DUSE_SSE3
74+
-DUSE_SSSE3
75+
# -m32 or -m64
76+
-m${GMMLIB_ARCH}
77+
)
11078
endif()
11179

11280
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")

0 commit comments

Comments
 (0)