annotate Resources/CMake/PixmanConfiguration.cmake @ 92:961ee171d933 wasm

cleaning up
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 29 May 2017 11:42:53 +0200
parents 28956ed68280
children 4cff7b1ed31d
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
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 39
diff changeset
4 # Copyright (C) 2017 Osimis, Belgium
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)
29
22ab2d8566fa move of third party downloads to the main server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 26
diff changeset
22 SET(PIXMAN_URL "http://www.orthanc-server.com/downloads/third-party/Stone/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
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
111 elseif (CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
112 ##########################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
113 ## Emscripten (asm.js)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
114 ##########################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
115
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
116 # No threading support
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
117 set(PIXMAN_DEFINITIONS "${PIXMAN_DEFINITIONS};PIXMAN_NO_TLS=1;HAVE_GCC_VECTOR_EXTENSIONS")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
118
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
119 elseif (CMAKE_SYSTEM_NAME STREQUAL "Windows")
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
120
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 ## Windows 32 or 64
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
123 ##########################
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 if (CMAKE_COMPILER_IS_GNUCXX)
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126 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
127
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
128 # The option "-mstackrealign" is necessary to avoid a crash on
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
129 # Windows if enabling SSE2. As an alternative, it is possible to
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130 # fully disable hardware acceleration.
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131 # https://bugs.freedesktop.org/show_bug.cgi?id=68300#c4
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2 -mssse3 -mstackrealign")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2 -mssse3 -mstackrealign")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134 endif()
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136 list(APPEND PIXMAN_SOURCES
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137 ${PIXMAN_SOURCES_DIR}/pixman/pixman-sse2.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138 ${PIXMAN_SOURCES_DIR}/pixman/pixman-ssse3.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
139 )
26
99b833843ba9 fix MSVC 64bit builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3
diff changeset
140
99b833843ba9 fix MSVC 64bit builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3
diff changeset
141 if ("${CMAKE_SIZEOF_VOID_P}" EQUAL "4")
99b833843ba9 fix MSVC 64bit builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3
diff changeset
142 # Only enable MMX on Windows 32
99b833843ba9 fix MSVC 64bit builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3
diff changeset
143 add_definitions(
99b833843ba9 fix MSVC 64bit builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3
diff changeset
144 -DUSE_X86_MMX=1
99b833843ba9 fix MSVC 64bit builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3
diff changeset
145 )
99b833843ba9 fix MSVC 64bit builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3
diff changeset
146 endif()
99b833843ba9 fix MSVC 64bit builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3
diff changeset
147
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
148 add_definitions(
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149 -DUSE_SSE2=1
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
150 -DUSE_SSSE3=1
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
151 )
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 ## Generic x86 processor
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156 ##########################
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 elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86" OR
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
159 CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
160 CMAKE_SYSTEM_NAME STREQUAL "NaCl32" OR
3
490347621f42 attempt to build for OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
161 CMAKE_SYSTEM_NAME STREQUAL "NaCl64" OR
490347621f42 attempt to build for OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
162 CMAKE_SYSTEM_NAME STREQUAL "Darwin")
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
163
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
164 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
165
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
166 if (${CMAKE_SYSTEM_NAME} STREQUAL "NaCl32" OR
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
167 ${CMAKE_SYSTEM_NAME} STREQUAL "NaCl64")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
168 # The MMX instructions lead to "unrecognized instruction" when
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
169 # validating ".nexe" files using "ncval", disable them
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
170 else()
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
171 #add_definitions(-DUSE_X86_MMX=1)
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
172 endif()
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
173
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
174 list(APPEND PIXMAN_SOURCES
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
175 ${PIXMAN_SOURCES_DIR}/pixman/pixman-sse2.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
176 ${PIXMAN_SOURCES_DIR}/pixman/pixman-ssse3.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
177 )
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
178 add_definitions(
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
179 -DUSE_SSE2=1
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
180 -DUSE_SSSE3=1
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
181 )
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
182 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2 -mssse3")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
183 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2 -mssse3")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
184
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 ## ARM processor
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
188 ##########################
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 elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "armv5te" OR
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
191 CMAKE_SYSTEM_PROCESSOR STREQUAL "armv6" OR
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
192 CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7-a" OR
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
193 CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
194
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
195 set(PIXMAN_DEFINITIONS "${PIXMAN_DEFINITIONS};TLS=__thread")
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 if (NEON)
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
198 message("Processor with NEON instructions")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
199 list(APPEND PIXMAN_SOURCES
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
200 ${PIXMAN_SOURCES_DIR}/pixman/pixman-arm-neon.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
201 ${PIXMAN_SOURCES_DIR}/pixman/pixman-arm-neon-asm.S
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
202 ${PIXMAN_SOURCES_DIR}/pixman/pixman-arm-neon-asm-bilinear.S
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
203 )
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
204 add_definitions(
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
205 -DUSE_ARM_NEON=1
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
206 )
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
207 elseif()
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
208 message("Processor without NEON instructions")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
209 endif()
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
210
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
211 add_definitions(
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
212 -DUSE_ARM_SIMD=1
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
213 )
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
214 list(APPEND PIXMAN_SOURCES
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
215 ${PIXMAN_SOURCES_DIR}/pixman/pixman-arm.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
216 ${PIXMAN_SOURCES_DIR}/pixman/pixman-arm-simd-asm.S
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
217 ${PIXMAN_SOURCES_DIR}/pixman/pixman-arm-simd-asm-scaled.S
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
218 ${PIXMAN_SOURCES_DIR}/pixman/pixman-arm-simd.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
219 )
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
220
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
221 else()
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
222 message(FATAL_ERROR "Support your platform here")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
223 endif()
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
224
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
225
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
226 include_directories(
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
227 ${PIXMAN_SOURCES_DIR}/pixman
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
228 )
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
229
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
230 set_property(
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
231 SOURCE ${PIXMAN_SOURCES}
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
232 PROPERTY COMPILE_DEFINITIONS ${PIXMAN_DEFINITIONS}
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
233 )
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
234
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
235 else()
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 pkg_search_module(PIXMAN REQUIRED pixman-1)
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
238 include_directories(${PIXMAN_INCLUDE_DIRS})
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
239 link_libraries(${PIXMAN_LIBRARIES})
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
240
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
241 endif()