annotate OrthancStone/Resources/CMake/PixmanConfiguration.cmake @ 1795:39673d351ef2

fix build
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 18 May 2021 09:57:14 +0200
parents 9ac2a65d4172
children 3889ae96d2e9
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
1739
9ac2a65d4172 upgrade to year 2021
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
4 # Copyright (C) 2017-2021 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
1598
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1597
diff changeset
7 # modify it under the terms of the GNU Lesser General Public License
47
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
1598
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1597
diff changeset
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1597
diff changeset
14 # Lesser General Public License for more details.
1597
f9e3a9c21c0f removed annoying whitespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
15 #
1598
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1597
diff changeset
16 # You should have received a copy of the GNU Lesser General Public
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1597
diff changeset
17 # License along with this program. If not, see
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1597
diff changeset
18 # <http://www.gnu.org/licenses/>.
47
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 39
diff changeset
19
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 39
diff changeset
20
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 if (STATIC_BUILD OR NOT USE_SYSTEM_PIXMAN)
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 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
23 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
24 SET(PIXMAN_MD5 "e80ebae4da01e77f68744319f01d52a3")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 if (IS_DIRECTORY "${PIXMAN_SOURCES_DIR}")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 set(FirstRun OFF)
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 else()
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 set(FirstRun ON)
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 endif()
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 DownloadPackage(${PIXMAN_MD5} ${PIXMAN_URL} "${PIXMAN_SOURCES_DIR}")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 # Apply a patch for NaCl32: This bypasses the custom implementation of
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 # "cpuid" that makes use of assembly code leading to "unrecognized
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 # instruction" when validating ".nexe" files using "ncval"
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 execute_process(
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 COMMAND ${PATCH_EXECUTABLE} -p0 -N -i ${CMAKE_CURRENT_LIST_DIR}/PixmanConfiguration.patch
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 RESULT_VARIABLE Failure
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
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 if (Failure AND FirstRun)
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 message(FATAL_ERROR "Error while patching a file")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 endif()
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 set(PIXMAN_VERSION_MAJOR 0)
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 set(PIXMAN_VERSION_MINOR 34)
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 set(PIXMAN_VERSION_MICRO 0)
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 configure_file(
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 ${PIXMAN_SOURCES_DIR}/pixman/pixman-version.h.in
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 ${PIXMAN_SOURCES_DIR}/pixman/pixman-version.h)
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 list(APPEND PIXMAN_SOURCES
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 ${PIXMAN_SOURCES_DIR}/pixman/pixman-access-accessors.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 ${PIXMAN_SOURCES_DIR}/pixman/pixman-access.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 ${PIXMAN_SOURCES_DIR}/pixman/pixman-arm.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 #${PIXMAN_SOURCES_DIR}/pixman/pixman-arm-neon.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 #${PIXMAN_SOURCES_DIR}/pixman/pixman-arm-simd.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 ${PIXMAN_SOURCES_DIR}/pixman/pixman-bits-image.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 ${PIXMAN_SOURCES_DIR}/pixman/pixman.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 ${PIXMAN_SOURCES_DIR}/pixman/pixman-combine32.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 ${PIXMAN_SOURCES_DIR}/pixman/pixman-combine-float.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64 ${PIXMAN_SOURCES_DIR}/pixman/pixman-conical-gradient.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 ${PIXMAN_SOURCES_DIR}/pixman/pixman-edge-accessors.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 ${PIXMAN_SOURCES_DIR}/pixman/pixman-edge.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 ${PIXMAN_SOURCES_DIR}/pixman/pixman-fast-path.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 ${PIXMAN_SOURCES_DIR}/pixman/pixman-filter.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 ${PIXMAN_SOURCES_DIR}/pixman/pixman-general.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 ${PIXMAN_SOURCES_DIR}/pixman/pixman-glyph.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 ${PIXMAN_SOURCES_DIR}/pixman/pixman-gradient-walker.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 ${PIXMAN_SOURCES_DIR}/pixman/pixman-image.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 ${PIXMAN_SOURCES_DIR}/pixman/pixman-implementation.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 ${PIXMAN_SOURCES_DIR}/pixman/pixman-linear-gradient.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 ${PIXMAN_SOURCES_DIR}/pixman/pixman-matrix.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 ${PIXMAN_SOURCES_DIR}/pixman/pixman-mips.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77 #${PIXMAN_SOURCES_DIR}/pixman/pixman-mips-dspr2.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78 ${PIXMAN_SOURCES_DIR}/pixman/pixman-mmx.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 ${PIXMAN_SOURCES_DIR}/pixman/pixman-noop.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 ${PIXMAN_SOURCES_DIR}/pixman/pixman-ppc.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81 ${PIXMAN_SOURCES_DIR}/pixman/pixman-radial-gradient.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 ${PIXMAN_SOURCES_DIR}/pixman/pixman-region16.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 ${PIXMAN_SOURCES_DIR}/pixman/pixman-region32.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 #${PIXMAN_SOURCES_DIR}/pixman/pixman-region.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 ${PIXMAN_SOURCES_DIR}/pixman/pixman-solid-fill.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 #${PIXMAN_SOURCES_DIR}/pixman/pixman-sse2.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87 #${PIXMAN_SOURCES_DIR}/pixman/pixman-ssse3.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88 ${PIXMAN_SOURCES_DIR}/pixman/pixman-timer.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 ${PIXMAN_SOURCES_DIR}/pixman/pixman-trap.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90 ${PIXMAN_SOURCES_DIR}/pixman/pixman-utils.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91 #${PIXMAN_SOURCES_DIR}/pixman/pixman-vmx.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92 ${PIXMAN_SOURCES_DIR}/pixman/pixman-x86.c
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
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95 set(PIXMAN_DEFINITIONS "PACKAGE=\"pixman\"")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 if (CMAKE_SYSTEM_PROCESSOR)
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98 message("Processor: ${CMAKE_SYSTEM_PROCESSOR}")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 else()
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 message("Processor: Not applicable")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101 endif()
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103
39
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
104 ##########################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
105 ## Portable Google NaCl
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
106 ##########################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
107
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
108 if (CMAKE_SYSTEM_NAME STREQUAL "PNaCl")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
109 # No hardware acceleration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
110 set(PIXMAN_DEFINITIONS "${PIXMAN_DEFINITIONS};TLS=__thread")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
111
263
38c795cc7c48 primitives for android ndk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 134
diff changeset
112 elseif (CMAKE_SYSTEM_NAME STREQUAL "Emscripten" OR
38c795cc7c48 primitives for android ndk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 134
diff changeset
113 CMAKE_SYSTEM_NAME STREQUAL "Android")
39
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
114 ##########################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
115 ## Emscripten (asm.js)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
116 ##########################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
117
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
118 # No threading support
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
119 set(PIXMAN_DEFINITIONS "${PIXMAN_DEFINITIONS};PIXMAN_NO_TLS=1;HAVE_GCC_VECTOR_EXTENSIONS")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
120
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
121 elseif (CMAKE_SYSTEM_NAME STREQUAL "Windows")
0
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 ##########################
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
124 ## Windows 32 or 64
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
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
127 if (CMAKE_COMPILER_IS_GNUCXX)
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
128 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
129
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130 # The option "-mstackrealign" is necessary to avoid a crash on
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131 # Windows if enabling SSE2. As an alternative, it is possible to
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132 # fully disable hardware acceleration.
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133 # https://bugs.freedesktop.org/show_bug.cgi?id=68300#c4
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2 -mssse3 -mstackrealign")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2 -mssse3 -mstackrealign")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136 endif()
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138 list(APPEND PIXMAN_SOURCES
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
139 ${PIXMAN_SOURCES_DIR}/pixman/pixman-sse2.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
140 ${PIXMAN_SOURCES_DIR}/pixman/pixman-ssse3.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
141 )
26
99b833843ba9 fix MSVC 64bit builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3
diff changeset
142
99b833843ba9 fix MSVC 64bit builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3
diff changeset
143 if ("${CMAKE_SIZEOF_VOID_P}" EQUAL "4")
99b833843ba9 fix MSVC 64bit builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3
diff changeset
144 # Only enable MMX on Windows 32
99b833843ba9 fix MSVC 64bit builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3
diff changeset
145 add_definitions(
99b833843ba9 fix MSVC 64bit builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3
diff changeset
146 -DUSE_X86_MMX=1
99b833843ba9 fix MSVC 64bit builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3
diff changeset
147 )
99b833843ba9 fix MSVC 64bit builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3
diff changeset
148 endif()
99b833843ba9 fix MSVC 64bit builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3
diff changeset
149
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
150 add_definitions(
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
151 -DUSE_SSE2=1
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
152 -DUSE_SSSE3=1
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 ##########################
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
157 ## Generic x86 processor
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
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
160 elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86" OR
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
161 CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
162 CMAKE_SYSTEM_NAME STREQUAL "NaCl32" OR
3
490347621f42 attempt to build for OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
163 CMAKE_SYSTEM_NAME STREQUAL "NaCl64" OR
490347621f42 attempt to build for OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
164 CMAKE_SYSTEM_NAME STREQUAL "Darwin")
0
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 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
167
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
168 if (${CMAKE_SYSTEM_NAME} STREQUAL "NaCl32" OR
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
169 ${CMAKE_SYSTEM_NAME} STREQUAL "NaCl64")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
170 # The MMX instructions lead to "unrecognized instruction" when
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
171 # validating ".nexe" files using "ncval", disable them
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
172 else()
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
173 #add_definitions(-DUSE_X86_MMX=1)
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
174 endif()
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
175
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
176 list(APPEND PIXMAN_SOURCES
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
177 ${PIXMAN_SOURCES_DIR}/pixman/pixman-sse2.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
178 ${PIXMAN_SOURCES_DIR}/pixman/pixman-ssse3.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
179 )
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
180 add_definitions(
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
181 -DUSE_SSE2=1
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
182 -DUSE_SSSE3=1
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
183 )
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
184 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2 -mssse3")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
185 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2 -mssse3")
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 ##########################
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
189 ## ARM processor
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
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
192 elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "armv5te" OR
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
193 CMAKE_SYSTEM_PROCESSOR STREQUAL "armv6" OR
283
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 263
diff changeset
194 CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7l" OR
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
195 CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7-a" OR
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
196 CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
197
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
198 set(PIXMAN_DEFINITIONS "${PIXMAN_DEFINITIONS};TLS=__thread")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
199
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
200 if (NEON)
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
201 message("Processor with NEON instructions")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
202 list(APPEND PIXMAN_SOURCES
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
203 ${PIXMAN_SOURCES_DIR}/pixman/pixman-arm-neon.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
204 ${PIXMAN_SOURCES_DIR}/pixman/pixman-arm-neon-asm.S
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
205 ${PIXMAN_SOURCES_DIR}/pixman/pixman-arm-neon-asm-bilinear.S
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 add_definitions(
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
208 -DUSE_ARM_NEON=1
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
209 )
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
210 elseif()
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
211 message("Processor without NEON instructions")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
212 endif()
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 add_definitions(
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
215 -DUSE_ARM_SIMD=1
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
216 )
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
217 list(APPEND PIXMAN_SOURCES
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
218 ${PIXMAN_SOURCES_DIR}/pixman/pixman-arm.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
219 ${PIXMAN_SOURCES_DIR}/pixman/pixman-arm-simd-asm.S
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
220 ${PIXMAN_SOURCES_DIR}/pixman/pixman-arm-simd-asm-scaled.S
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
221 ${PIXMAN_SOURCES_DIR}/pixman/pixman-arm-simd.c
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
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
224 else()
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
225 message(FATAL_ERROR "Support your platform here")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
226 endif()
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
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
229 include_directories(
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
230 ${PIXMAN_SOURCES_DIR}/pixman
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
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
233 set_property(
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
234 SOURCE ${PIXMAN_SOURCES}
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
235 PROPERTY COMPILE_DEFINITIONS ${PIXMAN_DEFINITIONS}
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
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
238 else()
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
239
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
240 pkg_search_module(PIXMAN REQUIRED pixman-1)
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
241 include_directories(${PIXMAN_INCLUDE_DIRS})
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
242 link_libraries(${PIXMAN_LIBRARIES})
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
243
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
244 endif()