Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
SRB2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Unmatched Bracket
SRB2
Commits
4a3dfae2
Commit
4a3dfae2
authored
2 years ago
by
Eidolon
Browse files
Options
Downloads
Patches
Plain Diff
cmake: build zlib manually in internal build
parent
00179e44
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
thirdparty/CMakeLists.txt
+45
-23
45 additions, 23 deletions
thirdparty/CMakeLists.txt
with
45 additions
and
23 deletions
thirdparty/CMakeLists.txt
+
45
−
23
View file @
4a3dfae2
...
...
@@ -57,30 +57,52 @@ if(NOT "${SRB2_CONFIG_SYSTEM_LIBRARIES}")
VERSION 1.2.13
URL
"https://github.com/madler/zlib/archive/refs/tags/v1.2.13.zip"
EXCLUDE_FROM_ALL
OPTIONS
# The assembly optimizations are unmaintained and slated to be removed
"ASM686 Off"
"AMD64 Off"
"SKIP_INSTALL_ALL ON"
DOWNLOAD_ONLY YES
)
file
(
MAKE_DIRECTORY
"
${
zlib_BINARY_DIR
}
/include"
)
file
(
COPY
"
${
zlib_SOURCE_DIR
}
/zlib.h"
DESTINATION
"
${
zlib_BINARY_DIR
}
/include"
)
file
(
COPY
"
${
zlib_BINARY_DIR
}
/zconf.h"
DESTINATION
"
${
zlib_BINARY_DIR
}
/include"
)
# honestly this should probably be built like png is
set_target_properties
(
zlib PROPERTIES EXCLUDE_FROM_ALL ON
)
set_target_properties
(
minigzip PROPERTIES EXCLUDE_FROM_ALL ON
)
set_target_properties
(
example PROPERTIES EXCLUDE_FROM_ALL ON
)
# zlib cmake also adds these 64 targets separately
if
(
HAVE_OFF64_T
)
set_target_properties
(
minigzip64 PROPERTIES EXCLUDE_FROM_ALL ON
)
set_target_properties
(
example64 PROPERTIES EXCLUDE_FROM_ALL ON
)
endif
()
target_include_directories
(
zlib INTERFACE
"
${
zlib_BINARY_DIR
}
/include"
)
target_include_directories
(
zlibstatic INTERFACE
"
${
zlib_BINARY_DIR
}
/include"
)
if
(
SRB2_CONFIG_SHARED_INTERNAL_LIBRARIES
)
add_library
(
ZLIB::ZLIB ALIAS zlib
)
else
()
add_library
(
ZLIB::ZLIB ALIAS zlibstatic
)
if
(
ZLIB_ADDED
)
set
(
ZLIB_SRCS
crc32.h
deflate.h
gzguts.h
inffast.h
inffixed.h
inflate.h
inftrees.h
trees.h
zutil.h
adler32.c
compress.c
crc32.c
deflate.c
gzclose.c
gzlib.c
gzread.c
gzwrite.c
inflate.c
infback.c
inftrees.c
inffast.c
trees.c
uncompr.c
zutil.c
)
list
(
TRANSFORM ZLIB_SRCS PREPEND
"
${
ZLIB_SOURCE_DIR
}
/"
)
configure_file
(
"
${
ZLIB_SOURCE_DIR
}
/zlib.pc.cmakein"
"
${
ZLIB_BINARY_DIR
}
/zlib.pc"
@ONLY
)
configure_file
(
"
${
ZLIB_SOURCE_DIR
}
/zconf.h.cmakein"
"
${
ZLIB_BINARY_DIR
}
/include/zconf.h"
@ONLY
)
add_library
(
ZLIB
${
SRB2_INTERNAL_LIBRARY_TYPE
}
${
ZLIB_SRCS
}
)
set_target_properties
(
ZLIB PROPERTIES
VERSION 1.2.13
OUTPUT_NAME
"z"
)
target_include_directories
(
ZLIB PRIVATE
"
${
ZLIB_SOURCE_DIR
}
"
)
target_include_directories
(
ZLIB PUBLIC
"
${
ZLIB_BINARY_DIR
}
/include"
)
if
(
MSVC
)
target_compile_definitions
(
ZLIB PRIVATE -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE
)
endif
()
add_library
(
ZLIB::ZLIB ALIAS ZLIB
)
endif
()
endif
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment