annotate Resources/CMake/PixmanConfiguration.cmake @ 686:0d42bda615a8 am-dev

fix codegen tests
author Alain Mazy <alain@mazy.be>
date Thu, 16 May 2019 16:45:10 +0200
parents bb658baeb967
children 2d8ab34c8c91
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
47
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 39
diff changeset
1 # Stone of Orthanc
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 39
diff changeset
2 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 39
diff changeset
3 # Department, University Hospital of Liege, Belgium
439
b70e9be013e4 preparing for 2019
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 283
diff changeset
4 # Copyright (C) 2017-2019 Osimis S.A., Belgium
47
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 39
diff changeset
5 #
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 39
diff changeset
6 # This program is free software: you can redistribute it and/or
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 39
diff changeset
7 # modify it under the terms of the GNU Affero General Public License
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 39
diff changeset
8 # as published by the Free Software Foundation, either version 3 of
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 39
diff changeset
9 # the License, or (at your option) any later version.
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 39
diff changeset
10 #
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 39
diff changeset
11 # This program is distributed in the hope that it will be useful, but
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 39
diff changeset
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 39
diff changeset
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 39
diff changeset
14 # Affero General Public License for more details.
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 39
diff changeset
15 #
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 39
diff changeset
16 # You should have received a copy of the GNU Affero General Public License
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 39
diff changeset
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 39
diff changeset
18
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 39
diff changeset
19
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 if (STATIC_BUILD OR NOT USE_SYSTEM_PIXMAN)
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 SET(PIXMAN_SOURCES_DIR ${CMAKE_BINARY_DIR}/pixman-0.34.0)
449
bb658baeb967 moving third-party dependencies to another server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 439
diff changeset
22 SET(PIXMAN_URL "http://orthanc.osimis.io/ThirdPartyDownloads/pixman-0.34.0.tar.gz")
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 SET(PIXMAN_MD5 "e80ebae4da01e77f68744319f01d52a3")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 if (IS_DIRECTORY "${PIXMAN_SOURCES_DIR}")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 set(FirstRun OFF)
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 else()
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 set(FirstRun ON)
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 endif()
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 DownloadPackage(${PIXMAN_MD5} ${PIXMAN_URL} "${PIXMAN_SOURCES_DIR}")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 # Apply a patch for NaCl32: This bypasses the custom implementation of
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 # "cpuid" that makes use of assembly code leading to "unrecognized
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 # instruction" when validating ".nexe" files using "ncval"
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 execute_process(
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 COMMAND ${PATCH_EXECUTABLE} -p0 -N -i ${CMAKE_CURRENT_LIST_DIR}/PixmanConfiguration.patch
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 RESULT_VARIABLE Failure
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 )
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 if (Failure AND FirstRun)
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 message(FATAL_ERROR "Error while patching a file")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 endif()
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 set(PIXMAN_VERSION_MAJOR 0)
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 set(PIXMAN_VERSION_MINOR 34)
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 set(PIXMAN_VERSION_MICRO 0)
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 configure_file(
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 ${PIXMAN_SOURCES_DIR}/pixman/pixman-version.h.in
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 ${PIXMAN_SOURCES_DIR}/pixman/pixman-version.h)
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 list(APPEND PIXMAN_SOURCES
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 ${PIXMAN_SOURCES_DIR}/pixman/pixman-access-accessors.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 ${PIXMAN_SOURCES_DIR}/pixman/pixman-access.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 ${PIXMAN_SOURCES_DIR}/pixman/pixman-arm.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 #${PIXMAN_SOURCES_DIR}/pixman/pixman-arm-neon.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 #${PIXMAN_SOURCES_DIR}/pixman/pixman-arm-simd.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 ${PIXMAN_SOURCES_DIR}/pixman/pixman-bits-image.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 ${PIXMAN_SOURCES_DIR}/pixman/pixman.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 ${PIXMAN_SOURCES_DIR}/pixman/pixman-combine32.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 ${PIXMAN_SOURCES_DIR}/pixman/pixman-combine-float.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 ${PIXMAN_SOURCES_DIR}/pixman/pixman-conical-gradient.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64 ${PIXMAN_SOURCES_DIR}/pixman/pixman-edge-accessors.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 ${PIXMAN_SOURCES_DIR}/pixman/pixman-edge.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 ${PIXMAN_SOURCES_DIR}/pixman/pixman-fast-path.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 ${PIXMAN_SOURCES_DIR}/pixman/pixman-filter.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 ${PIXMAN_SOURCES_DIR}/pixman/pixman-general.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 ${PIXMAN_SOURCES_DIR}/pixman/pixman-glyph.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 ${PIXMAN_SOURCES_DIR}/pixman/pixman-gradient-walker.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 ${PIXMAN_SOURCES_DIR}/pixman/pixman-image.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 ${PIXMAN_SOURCES_DIR}/pixman/pixman-implementation.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 ${PIXMAN_SOURCES_DIR}/pixman/pixman-linear-gradient.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 ${PIXMAN_SOURCES_DIR}/pixman/pixman-matrix.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 ${PIXMAN_SOURCES_DIR}/pixman/pixman-mips.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 #${PIXMAN_SOURCES_DIR}/pixman/pixman-mips-dspr2.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77 ${PIXMAN_SOURCES_DIR}/pixman/pixman-mmx.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78 ${PIXMAN_SOURCES_DIR}/pixman/pixman-noop.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 ${PIXMAN_SOURCES_DIR}/pixman/pixman-ppc.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 ${PIXMAN_SOURCES_DIR}/pixman/pixman-radial-gradient.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81 ${PIXMAN_SOURCES_DIR}/pixman/pixman-region16.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 ${PIXMAN_SOURCES_DIR}/pixman/pixman-region32.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 #${PIXMAN_SOURCES_DIR}/pixman/pixman-region.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 ${PIXMAN_SOURCES_DIR}/pixman/pixman-solid-fill.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 #${PIXMAN_SOURCES_DIR}/pixman/pixman-sse2.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 #${PIXMAN_SOURCES_DIR}/pixman/pixman-ssse3.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87 ${PIXMAN_SOURCES_DIR}/pixman/pixman-timer.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88 ${PIXMAN_SOURCES_DIR}/pixman/pixman-trap.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 ${PIXMAN_SOURCES_DIR}/pixman/pixman-utils.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90 #${PIXMAN_SOURCES_DIR}/pixman/pixman-vmx.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91 ${PIXMAN_SOURCES_DIR}/pixman/pixman-x86.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92 )
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94 set(PIXMAN_DEFINITIONS "PACKAGE=\"pixman\"")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96 if (CMAKE_SYSTEM_PROCESSOR)
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 message("Processor: ${CMAKE_SYSTEM_PROCESSOR}")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98 else()
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 message("Processor: Not applicable")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 endif()
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102
39
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
103 ##########################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
104 ## Portable Google NaCl
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
105 ##########################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
106
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
107 if (CMAKE_SYSTEM_NAME STREQUAL "PNaCl")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
108 # No hardware acceleration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
109 set(PIXMAN_DEFINITIONS "${PIXMAN_DEFINITIONS};TLS=__thread")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
110
263
38c795cc7c48 primitives for android ndk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 134
diff changeset
111 elseif (CMAKE_SYSTEM_NAME STREQUAL "Emscripten" OR
38c795cc7c48 primitives for android ndk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 134
diff changeset
112 CMAKE_SYSTEM_NAME STREQUAL "Android")
39
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
113 ##########################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
114 ## Emscripten (asm.js)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
115 ##########################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
116
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
117 # No threading support
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
118 set(PIXMAN_DEFINITIONS "${PIXMAN_DEFINITIONS};PIXMAN_NO_TLS=1;HAVE_GCC_VECTOR_EXTENSIONS")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
119
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
120 elseif (CMAKE_SYSTEM_NAME STREQUAL "Windows")
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
121
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
122 ##########################
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
123 ## Windows 32 or 64
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
124 ##########################
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
125
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126 if (CMAKE_COMPILER_IS_GNUCXX)
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
127 set(PIXMAN_DEFINITIONS "${PIXMAN_DEFINITIONS};TLS=__thread;HAVE_GCC_VECTOR_EXTENSIONS;HAVE_BUILTIN_CLZ;HAVE_FEDIVBYZERO=1;HAVE_FENV_H=1;HAVE_MPROTECT=1;HAVE_FLOAT128;HAVE_POSIX_MEMALIGN;USE_GCC_INLINE_ASM=1;HAVE_GETPAGESIZE=1")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
128
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
129 # The option "-mstackrealign" is necessary to avoid a crash on
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130 # Windows if enabling SSE2. As an alternative, it is possible to
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131 # fully disable hardware acceleration.
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132 # https://bugs.freedesktop.org/show_bug.cgi?id=68300#c4
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2 -mssse3 -mstackrealign")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2 -mssse3 -mstackrealign")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135 endif()
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137 list(APPEND PIXMAN_SOURCES
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138 ${PIXMAN_SOURCES_DIR}/pixman/pixman-sse2.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
139 ${PIXMAN_SOURCES_DIR}/pixman/pixman-ssse3.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
140 )
26
99b833843ba9 fix MSVC 64bit builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3
diff changeset
141
99b833843ba9 fix MSVC 64bit builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3
diff changeset
142 if ("${CMAKE_SIZEOF_VOID_P}" EQUAL "4")
99b833843ba9 fix MSVC 64bit builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3
diff changeset
143 # Only enable MMX on Windows 32
99b833843ba9 fix MSVC 64bit builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3
diff changeset
144 add_definitions(
99b833843ba9 fix MSVC 64bit builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3
diff changeset
145 -DUSE_X86_MMX=1
99b833843ba9 fix MSVC 64bit builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3
diff changeset
146 )
99b833843ba9 fix MSVC 64bit builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3
diff changeset
147 endif()
99b833843ba9 fix MSVC 64bit builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3
diff changeset
148
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149 add_definitions(
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
150 -DUSE_SSE2=1
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
151 -DUSE_SSSE3=1
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
152 )
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
154
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
155 ##########################
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156 ## Generic x86 processor
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
157 ##########################
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
158
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
159 elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86" OR
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
160 CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
161 CMAKE_SYSTEM_NAME STREQUAL "NaCl32" OR
3
490347621f42 attempt to build for OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
162 CMAKE_SYSTEM_NAME STREQUAL "NaCl64" OR
490347621f42 attempt to build for OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
163 CMAKE_SYSTEM_NAME STREQUAL "Darwin")
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
164
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
165 set(PIXMAN_DEFINITIONS "${PIXMAN_DEFINITIONS};TLS=__thread;HAVE_GCC_VECTOR_EXTENSIONS;HAVE_BUILTIN_CLZ;HAVE_MPROTECT=1;HAVE_FLOAT128;HAVE_POSIX_MEMALIGN;USE_GCC_INLINE_ASM;HAVE_GETPAGESIZE=1")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
166
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
167 if (${CMAKE_SYSTEM_NAME} STREQUAL "NaCl32" OR
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
168 ${CMAKE_SYSTEM_NAME} STREQUAL "NaCl64")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
169 # The MMX instructions lead to "unrecognized instruction" when
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
170 # validating ".nexe" files using "ncval", disable them
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
171 else()
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
172 #add_definitions(-DUSE_X86_MMX=1)
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
173 endif()
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
174
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
175 list(APPEND PIXMAN_SOURCES
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
176 ${PIXMAN_SOURCES_DIR}/pixman/pixman-sse2.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
177 ${PIXMAN_SOURCES_DIR}/pixman/pixman-ssse3.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
178 )
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
179 add_definitions(
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
180 -DUSE_SSE2=1
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
181 -DUSE_SSSE3=1
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
182 )
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
183 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2 -mssse3")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
184 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2 -mssse3")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
185
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
186
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
187 ##########################
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
188 ## ARM processor
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
189 ##########################
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
190
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
191 elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "armv5te" OR
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
192 CMAKE_SYSTEM_PROCESSOR STREQUAL "armv6" OR
283
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 263
diff changeset
193 CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7l" OR
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
194 CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7-a" OR
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
195 CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
196
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
197 set(PIXMAN_DEFINITIONS "${PIXMAN_DEFINITIONS};TLS=__thread")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
198
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
199 if (NEON)
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
200 message("Processor with NEON instructions")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
201 list(APPEND PIXMAN_SOURCES
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
202 ${PIXMAN_SOURCES_DIR}/pixman/pixman-arm-neon.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
203 ${PIXMAN_SOURCES_DIR}/pixman/pixman-arm-neon-asm.S
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
204 ${PIXMAN_SOURCES_DIR}/pixman/pixman-arm-neon-asm-bilinear.S
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
205 )
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
206 add_definitions(
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
207 -DUSE_ARM_NEON=1
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
208 )
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
209 elseif()
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
210 message("Processor without NEON instructions")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
211 endif()
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
212
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
213 add_definitions(
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
214 -DUSE_ARM_SIMD=1
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
215 )
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
216 list(APPEND PIXMAN_SOURCES
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
217 ${PIXMAN_SOURCES_DIR}/pixman/pixman-arm.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
218 ${PIXMAN_SOURCES_DIR}/pixman/pixman-arm-simd-asm.S
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
219 ${PIXMAN_SOURCES_DIR}/pixman/pixman-arm-simd-asm-scaled.S
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
220 ${PIXMAN_SOURCES_DIR}/pixman/pixman-arm-simd.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
221 )
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
222
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
223 else()
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
224 message(FATAL_ERROR "Support your platform here")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
225 endif()
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
226
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
227
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
228 include_directories(
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
229 ${PIXMAN_SOURCES_DIR}/pixman
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
230 )
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
231
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
232 set_property(
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
233 SOURCE ${PIXMAN_SOURCES}
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
234 PROPERTY COMPILE_DEFINITIONS ${PIXMAN_DEFINITIONS}
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
235 )
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
236
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
237 else()
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
238
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
239 pkg_search_module(PIXMAN REQUIRED pixman-1)
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
240 include_directories(${PIXMAN_INCLUDE_DIRS})
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
241 link_libraries(${PIXMAN_LIBRARIES})
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
242
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
243 endif()