Skip to content

Commit b5d7cc3

Browse files
committed
Updated cmake helpers to latest patches-track-wip (TD 5.0.6)
2 parents 342cd3a + a7527c0 commit b5d7cc3

File tree

27 files changed

+193
-120
lines changed

27 files changed

+193
-120
lines changed

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
# https://github.com/desktop-app/legal/blob/master/LEGAL
66

77
add_subdirectory(external)
8+
if (LINUX AND NOT DESKTOP_APP_DISABLE_JEMALLOC)
9+
add_subdirectory(linux_jemalloc_helper)
10+
endif()
811
if (DESKTOP_APP_USE_ALLOCATION_TRACER)
912
add_subdirectory(linux_allocation_tracer)
1013
endif()

external/CMakeLists.txt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ if (add_hunspell_library)
3838
add_checked_subdirectory(hunspell)
3939
endif()
4040
add_checked_subdirectory(iconv)
41+
if (LINUX AND NOT DESKTOP_APP_DISABLE_JEMALLOC)
42+
add_checked_subdirectory(jemalloc)
43+
endif()
4144
add_checked_subdirectory(jpeg)
4245
add_checked_subdirectory(kcoreaddons)
4346
add_checked_subdirectory(kimageformats)
@@ -54,15 +57,9 @@ add_checked_subdirectory(qr_code_generator)
5457
add_checked_subdirectory(ranges)
5558
add_checked_subdirectory(rlottie)
5659
add_checked_subdirectory(rnnoise)
57-
if (LINUX AND NOT DESKTOP_APP_DISABLE_SCUDO)
58-
add_checked_subdirectory(scudo)
59-
endif()
6060
add_checked_subdirectory(ton)
6161
add_checked_subdirectory(variant)
6262
add_checked_subdirectory(vpx)
63-
if (LINUX AND NOT DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION)
64-
add_checked_subdirectory(wayland_client)
65-
endif()
6663
add_checked_subdirectory(webrtc)
6764
if (LINUX AND NOT DESKTOP_APP_DISABLE_X11_INTEGRATION)
6865
add_checked_subdirectory(xcb)

external/cld3/CMakeLists.txt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ init_target(external_cld3_bundled "(external)")
1313
set(cld3_loc ${third_party_loc}/cld3)
1414
set(cld3_src ${cld3_loc}/src)
1515

16-
set(gen_loc ${cld3_loc}/build/gen)
16+
set(gen_loc ${CMAKE_CURRENT_BINARY_DIR}/gen)
1717
set(gen_dst ${gen_loc}/cld_3/protos)
1818

19-
if (DESKTOP_APP_USE_PACKAGED)
19+
if (DESKTOP_APP_USE_PACKAGED OR LINUX)
2020
find_package(Protobuf)
2121
if (NOT Protobuf_FOUND)
2222
find_package(protobuf REQUIRED CONFIG)
@@ -30,9 +30,6 @@ elseif (WIN32)
3030
else()
3131
set(protoc_executable ${libs_loc}/protobuf/build/protoc)
3232
set(protobuf_lib ${libs_loc}/protobuf/build/libprotobuf-lite.a)
33-
if (LINUX)
34-
target_compile_options(external_cld3_bundled PRIVATE -Wno-implicit-fallthrough)
35-
endif()
3633
endif()
3734
if (PROTOBUF_PROTOC_EXECUTABLE)
3835
set(protoc_executable ${PROTOBUF_PROTOC_EXECUTABLE})
@@ -87,13 +84,18 @@ PRIVATE
8784
script_span/fixunicodevalue.cc
8885
)
8986

87+
target_compile_options_if_exists(external_cld3_bundled
88+
PRIVATE
89+
-Wno-implicit-fallthrough
90+
)
91+
9092
target_include_directories(external_cld3_bundled
9193
PUBLIC
9294
${cld3_src}
9395
${gen_loc}
9496
)
9597

96-
if (NOT DESKTOP_APP_USE_PACKAGED)
98+
if (NOT DESKTOP_APP_USE_PACKAGED AND NOT LINUX)
9799
target_include_directories(external_cld3_bundled
98100
PUBLIC
99101
${libs_loc}/protobuf/src

external/glib/cppgir

Submodule cppgir updated from 83d9474 to 9c4f582

external/glib/generate_gir.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ function(generate_gir target_name namespace deps src_target_name)
1919
BYPRODUCTS
2020
${gen_file}
2121
COMMAND
22+
env
23+
$<$<BOOL:${DESKTOP_APP_ASAN}>:LDFLAGS=-fsanitize=address>
2224
${DESKTOP_APP_GIRSCANNER}
2325
--quiet
2426
-n

external/jemalloc/CMakeLists.txt

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# This file is part of Desktop App Toolkit,
2+
# a set of libraries for developing nice desktop applications.
3+
#
4+
# For license and copyright information please follow this link:
5+
# https://github.com/desktop-app/legal/blob/master/LEGAL
6+
7+
add_library(external_jemalloc INTERFACE IMPORTED GLOBAL)
8+
add_library(desktop-app::external_jemalloc ALIAS external_jemalloc)
9+
10+
if (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
11+
return()
12+
endif()
13+
14+
if (DESKTOP_APP_USE_PACKAGED)
15+
find_package(PkgConfig REQUIRED)
16+
pkg_check_modules(JEMALLOC jemalloc)
17+
18+
if (JEMALLOC_FOUND)
19+
target_include_directories(external_jemalloc SYSTEM
20+
INTERFACE
21+
${JEMALLOC_INCLUDE_DIRS}
22+
)
23+
24+
target_link_libraries(external_jemalloc
25+
INTERFACE
26+
-Wl,--push-state,--no-as-needed,${JEMALLOC_LINK_LIBRARIES},--pop-state
27+
)
28+
29+
return()
30+
endif()
31+
endif()
32+
33+
include(ProcessorCount)
34+
ProcessorCount(N)
35+
36+
include(ExternalProject)
37+
ExternalProject_Add(jemalloc
38+
URL ${third_party_loc}/jemalloc
39+
CONFIGURE_COMMAND env
40+
"$<IF:$<OR:$<NOT:$<BOOL:${DESKTOP_APP_USE_PACKAGED}>>,$<BOOL:${DESKTOP_APP_SPECIAL_TARGET}>>,EXTRA_CFLAGS=-fno-omit-frame-pointer -fstack-protector-all -fstack-clash-protection -fcf-protection -DNDEBUG -D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS,=>"
41+
"$<IF:$<OR:$<NOT:$<BOOL:${DESKTOP_APP_USE_PACKAGED}>>,$<BOOL:${DESKTOP_APP_SPECIAL_TARGET}>>,EXTRA_CXXFLAGS=-fno-omit-frame-pointer -fstack-protector-all -fstack-clash-protection -fcf-protection -DNDEBUG -D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS,=>"
42+
./autogen.sh --disable-shared
43+
BUILD_COMMAND make $<$<NOT:$<EQUAL:${N},0>>:-j${N}>
44+
BUILD_IN_SOURCE 1
45+
STEP_TARGETS build
46+
EXCLUDE_FROM_ALL TRUE
47+
BUILD_BYPRODUCTS <SOURCE_DIR>/lib/libjemalloc_pic.a
48+
)
49+
50+
ExternalProject_Get_property(jemalloc SOURCE_DIR)
51+
file(MAKE_DIRECTORY "${SOURCE_DIR}/include")
52+
53+
target_include_directories(external_jemalloc SYSTEM
54+
INTERFACE
55+
${SOURCE_DIR}/include
56+
)
57+
58+
target_link_libraries(external_jemalloc
59+
INTERFACE
60+
-Wl,--push-state,--whole-archive,${SOURCE_DIR}/lib/libjemalloc_pic.a,--pop-state
61+
)
62+
63+
add_dependencies(external_jemalloc jemalloc-build)

external/jpeg/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,5 @@ else()
3232
set_target_properties(external_jpeg PROPERTIES
3333
IMPORTED_LOCATION "${DESKTOP_APP_JPEG_LIBRARIES}"
3434
)
35+
target_link_static_libraries(external_jpeg INTERFACE hwy)
3536
endif()

external/kimageformats/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ PRIVATE
2525
heif.cpp
2626
jxl.cpp
2727
qoi.cpp
28+
scanlineconverter.cpp
2829
)
2930

3031
target_compile_definitions(external_kimageformats
@@ -101,13 +102,15 @@ elseif (APPLE)
101102
${libs_loc}/local/lib/libbrotlidec-static.a
102103
${libs_loc}/local/lib/libbrotlienc-static.a
103104
${libs_loc}/local/lib/libbrotlicommon-static.a
105+
${libs_loc}/local/lib/liblcms2.a
104106
)
105107
else()
106108
target_link_static_libraries(external_kimageformats
107109
PRIVATE
108110
avif
109111
heif
110112
jxl
113+
jxl_cms
111114
jxl_threads
112115
dav1d
113116
de265

external/kimageformats/init.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ For license and copyright information please follow this link:
1010
Q_IMPORT_PLUGIN(QAVIFPlugin)
1111
Q_IMPORT_PLUGIN(HEIFPlugin)
1212
Q_IMPORT_PLUGIN(QJpegXLPlugin)
13+
Q_IMPORT_PLUGIN(QOIPlugin)

external/openal/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ elseif (APPLE)
4141
else()
4242
target_include_directories(external_openal SYSTEM
4343
INTERFACE
44-
/usr/local/include
4544
/usr/local/include/AL
4645
)
4746
target_link_static_libraries(external_openal

0 commit comments

Comments
 (0)