Buildbot: Usable PIE
[blender.git] / build_files / buildbot / config / blender_linux.cmake
1 # ######## Global feature set settings ########
2
3 include("${CMAKE_CURRENT_LIST_DIR}/../../cmake/config/blender_release.cmake")
4
5 # Detect which libc we'll be linking against.
6 # Some of the paths will depend on this
7
8 if(EXISTS "/lib/x86_64-linux-gnu/libc-2.24.so")
9         message(STATUS "Building in GLibc-2.24 environment")
10         set(GLIBC "2.24")
11         set(MULTILIB "/x86_64-linux-gnu")
12         set(LIBDIR_NAME "linux_x86_64")
13 elseif(EXISTS "/lib/i386-linux-gnu//libc-2.24.so")
14         message(STATUS "Building in GLibc-2.24 environment")
15         set(GLIBC "2.24")
16         set(MULTILIB "/i386-linux-gnu")
17         set(LIBDIR_NAME "linux_i686")
18 elseif(EXISTS "/lib/x86_64-linux-gnu/libc-2.19.so")
19         message(STATUS "Building in GLibc-2.19 environment")
20         set(GLIBC "2.19")
21         set(MULTILIB "/x86_64-linux-gnu")
22 elseif(EXISTS "/lib/i386-linux-gnu//libc-2.19.so")
23         message(STATUS "Building in GLibc-2.19 environment")
24         set(GLIBC "2.19")
25         set(MULTILIB "/i386-linux-gnu")
26 elseif(EXISTS "/lib/libc-2.11.3.so")
27         message(STATUS "Building in GLibc-2.11 environment")
28         set(GLIBC "2.11")
29         set(MULTILIB "")
30 else()
31         message(FATAL_ERROR "Unknown build environment")
32 endif()
33
34 # Default to only build Blender, not the player
35 set(WITH_BLENDER             ON  CACHE BOOL "" FORCE)
36 set(WITH_PLAYER              OFF CACHE BOOL "" FORCE)
37
38 # ######## Linux-specific build options ########
39 # Options which are specific to Linux-only platforms
40 set(WITH_DOC_MANPAGE         OFF CACHE BOOL "" FORCE)
41
42 # ######## Official release-specific build options ########
43 # Options which are specific to Linux release builds only
44 set(WITH_JACK_DYNLOAD        ON  CACHE BOOL "" FORCE)
45 set(WITH_SDL_DYNLOAD         ON  CACHE BOOL "" FORCE)
46 set(WITH_SYSTEM_GLEW         OFF CACHE BOOL "" FORCE)
47
48 set(WITH_OPENMP_STATIC       ON  CACHE BOOL "" FORCE)
49
50 set(WITH_PYTHON_INSTALL_NUMPY    ON CACHE BOOL "" FORCE)
51 set(WITH_PYTHON_INSTALL_REQUESTS ON CACHE BOOL "" FORCE)
52
53 # ######## Release environment specific settings ########
54
55 if (NOT ${GLIBC} STREQUAL "2.24")
56
57 # All the hardcoded library paths and such
58
59 # LLVM libraries
60 set(LLVM_VERSION             "3.4"  CACHE STRING "" FORCE)
61 set(LLVM_ROOT_DIR            "/opt/lib/llvm-${LLVM_VERSION}"  CACHE STRING "" FORCE)
62 set(LLVM_STATIC              ON  CACHE BOOL "" FORCE)
63
64 # BOOST libraries
65 set(BOOST_ROOT               "/opt/lib/boost" CACHE STRING "" FORCE)
66 set(Boost_USE_STATIC_LIBS    ON CACHE BOOL "" FORCE)
67
68 # FFmpeg libraries
69 set(FFMPEG                   "/opt/lib/ffmpeg" CACHE STRING "" FORCE)
70 set(FFMPEG_LIBRARIES
71         avdevice avformat avcodec avutil avfilter swscale swresample
72         /usr/lib${MULTILIB}/libxvidcore.a
73         /usr/lib${MULTILIB}/libx264.a
74         /usr/lib${MULTILIB}/libmp3lame.a
75         /usr/lib${MULTILIB}/libvpx.a
76         /usr/lib${MULTILIB}/libvorbis.a
77         /usr/lib${MULTILIB}/libogg.a
78         /usr/lib${MULTILIB}/libvorbisenc.a
79         /usr/lib${MULTILIB}/libtheora.a
80         /usr/lib${MULTILIB}/libschroedinger-1.0.a
81         /usr/lib${MULTILIB}/liborc-0.4.a
82         CACHE STRING "" FORCE
83 )
84
85 # SndFile libraries
86 set(SNDFILE_LIBRARY          "/usr/lib${MULTILIB}/libsndfile.a;/usr/lib${MULTILIB}/libFLAC.a" CACHE STRING "" FORCE)
87
88 # OpenAL libraries
89 set(OPENAL_ROOT_DIR           "/opt/lib/openal" CACHE STRING "" FORCE)
90 set(OPENAL_INCLUDE_DIR        "${OPENAL_ROOT_DIR}/include/AL" CACHE STRING "" FORCE)
91 set(OPENAL_LIBRARY
92         ${OPENAL_ROOT_DIR}/lib/libopenal.a
93         ${OPENAL_ROOT_DIR}/lib/libcommon.a
94         CACHE STRING "" FORCE
95 )
96
97 # OpenCollada libraries
98 set(OPENCOLLADA_UTF_LIBRARY   ""                              CACHE STRING "" FORCE)
99 set(PCRE_INCLUDE_DIR          "/usr/include"                  CACHE STRING "" FORCE)
100 set(PCRE_LIBRARY              "/usr/lib${MULTILIB}/libpcre.a" CACHE STRING "" FORCE)
101 set(XML2_INCLUDE_DIR          "/usr/include"                  CACHE STRING "" FORCE)
102 set(XML2_LIBRARY              "/usr/lib${MULTILIB}/libxml2.a" CACHE STRING "" FORCE)
103
104 # OpenColorIO libraries
105 set(OPENCOLORIO_ROOT_DIR      "/opt/lib/ocio" CACHE STRING "" FORCE)
106 set(OPENCOLORIO_OPENCOLORIO_LIBRARY "${OPENCOLORIO_ROOT_DIR}/lib/libOpenColorIO.a" CACHE STRING "" FORCE)
107 set(OPENCOLORIO_TINYXML_LIBRARY "${OPENCOLORIO_ROOT_DIR}/lib/libtinyxml.a"         CACHE STRING "" FORCE)
108 set(OPENCOLORIO_YAML-CPP_LIBRARY "${OPENCOLORIO_ROOT_DIR}/lib/libyaml-cpp.a"       CACHE STRING "" FORCE)
109
110 # Freetype
111 set(FREETYPE_INCLUDE_DIRS "/usr/include/freetype2"       CACHE STRING "" FORCE)
112 set(FREETYPE_LIBRARY "/usr/lib${MULTILIB}/libfreetype.a" CACHE STRING "" FORCE)
113
114 # OpenImageIO
115 if(GLIBC EQUAL "2.19")
116         set(OPENIMAGEIO_LIBRARY
117                 /opt/lib/oiio/lib/libOpenImageIO.a
118                 /opt/lib/oiio/lib/libOpenImageIO_Util.a
119                 /usr/lib${MULTILIB}/libwebp.a
120                 /usr/lib${MULTILIB}/liblzma.a
121                 /usr/lib${MULTILIB}/libjbig.a
122                 ${FREETYPE_LIBRARY}
123                 CACHE STRING "" FORCE
124         )
125 endif()
126
127 # OpenSubdiv libraries
128 set(OPENSUBDIV_ROOT_DIR "/opt/lib/opensubdiv" CACHE STRING "" FORCE)
129 set(OPENSUBDIV_OSDCPU_LIBRARY "${OPENSUBDIV_ROOT_DIR}/lib/libosdCPU.a" CACHE STRING "" FORCE)
130 set(OPENSUBDIV_OSDGPU_LIBRARY "${OPENSUBDIV_ROOT_DIR}/lib/libosdGPU.a" CACHE STRING "" FORCE)
131
132 # OpenEXR libraries
133 set(OPENEXR_ROOT_DIR          "/opt/lib/openexr"                    CACHE STRING "" FORCE)
134 set(OPENEXR_HALF_LIBRARY      "/opt/lib/openexr/lib/libHalf.a"      CACHE STRING "" FORCE)
135 set(OPENEXR_IEX_LIBRARY       "/opt/lib/openexr/lib/libIex.a"       CACHE STRING "" FORCE)
136 set(OPENEXR_ILMIMF_LIBRARY    "/opt/lib/openexr/lib/libIlmImf.a"    CACHE STRING "" FORCE)
137 set(OPENEXR_ILMTHREAD_LIBRARY "/opt/lib/openexr/lib/libIlmThread.a" CACHE STRING "" FORCE)
138 set(OPENEXR_IMATH_LIBRARY     "/opt/lib/openexr/lib/libImath.a"     CACHE STRING "" FORCE)
139
140 # JeMalloc library
141 set(JEMALLOC_LIBRARY    "/opt/lib/jemalloc/lib/libjemalloc.a" CACHE STRING "" FORCE)
142
143 # Space navigation
144 set(SPACENAV_ROOT_DIR       "/opt/lib/libspnav" CACHE STRING "" FORCE)
145
146 # Force some system libraries to be static
147 set(FFTW3_LIBRARY       "/usr/lib${MULTILIB}/libfftw3.a" CACHE STRING "" FORCE)
148 set(JPEG_LIBRARY        "/usr/lib${MULTILIB}/libjpeg.a"  CACHE STRING "" FORCE)
149 set(PNG_LIBRARY         "/usr/lib${MULTILIB}/libpng.a"   CACHE STRING "" FORCE)
150 set(TIFF_LIBRARY        "/usr/lib${MULTILIB}/libtiff.a"  CACHE STRING "" FORCE)
151 set(ZLIB_LIBRARY        "/usr/lib${MULTILIB}/libz.a"     CACHE STRING "" FORCE)
152
153 # OpenVDB
154 set(OPENVDB_LIBRARY
155         /opt/lib/openvdb/lib/libopenvdb.a
156         CACHE BOOL "" FORCE
157 )
158
159 set(BLOSC_LIBRARY
160         /opt/lib/blosc/lib/libblosc.a
161         CACHE BOOL "" FORCE
162 )
163
164 else()
165
166 set(LIBDIR "/opt/blender-deps/${LIBDIR_NAME}" CACHE BOOL "" FORCE)
167
168 # TODO(sergey): Remove once Python is oficially bumped to 3.7.
169 set(PYTHON_VERSION    3.7 CACHE BOOL "" FORCE)
170
171 # Platform specific configuration, to ensure static linking against everything.
172
173 set(Boost_USE_STATIC_LIBS    ON CACHE BOOL "" FORCE)
174
175 # TODO(sergey): Move up to the rest of WITH_SYSTEM and DYNLOAD configuration,
176 # once old chroot is officially retired.
177 set(WITH_SYSTEM_OPENJPEG     ON CACHE BOOL "" FORCE)
178
179 # We need to link OpenCOLLADA against PCRE library. Even though it is not installed
180 # on /usr, we do not really care -- all we care is PCRE_FOUND be TRUE and its
181 # library pointing to a valid one.
182 set(PCRE_INCLUDE_DIR          "/usr/include"                        CACHE STRING "" FORCE)
183 set(PCRE_LIBRARY              "${LIBDIR}/opencollada/lib/libpcre.a" CACHE STRING "" FORCE)
184
185 endif()
186
187 # Additional linking libraries
188 set(CMAKE_EXE_LINKER_FLAGS   "-lrt -static-libstdc++ -no-pie"  CACHE STRING "" FORCE)