2010-01-21 15:12:50 +00:00
|
|
|
# zlib library
|
|
|
|
|
|
|
|
# library name
|
2010-06-11 13:51:43 +00:00
|
|
|
set(zlibName pcsx2_zlib)
|
2010-01-21 15:12:50 +00:00
|
|
|
|
2010-06-04 11:07:25 +00:00
|
|
|
set(CommonFlags
|
|
|
|
-W
|
|
|
|
-m32
|
|
|
|
)
|
|
|
|
|
2010-06-04 17:31:55 +00:00
|
|
|
set(OptimizationFlags
|
|
|
|
-Os
|
|
|
|
)
|
|
|
|
|
2010-01-22 04:36:49 +00:00
|
|
|
# Debug - Build
|
|
|
|
if(CMAKE_BUILD_TYPE STREQUAL Debug)
|
|
|
|
# add defines
|
2010-06-04 17:31:55 +00:00
|
|
|
add_definitions(${CommonFlags} -g)
|
2010-01-22 04:36:49 +00:00
|
|
|
endif(CMAKE_BUILD_TYPE STREQUAL Debug)
|
|
|
|
|
|
|
|
# Devel - Build
|
|
|
|
if(CMAKE_BUILD_TYPE STREQUAL Devel)
|
|
|
|
# add defines
|
2010-06-04 17:31:55 +00:00
|
|
|
add_definitions(${CommonFlags} ${OptimizationFlags})
|
2010-01-22 04:36:49 +00:00
|
|
|
endif(CMAKE_BUILD_TYPE STREQUAL Devel)
|
|
|
|
|
|
|
|
# Release - Build
|
|
|
|
if(CMAKE_BUILD_TYPE STREQUAL Release)
|
|
|
|
# add defines
|
2010-06-04 17:31:55 +00:00
|
|
|
add_definitions(${CommonFlags} ${OptimizationFlags})
|
2010-01-22 04:36:49 +00:00
|
|
|
endif(CMAKE_BUILD_TYPE STREQUAL Release)
|
|
|
|
|
2010-01-21 15:12:50 +00:00
|
|
|
# variable with all sources of this library
|
|
|
|
set(zlibSources
|
2010-06-04 11:07:25 +00:00
|
|
|
compress.c
|
|
|
|
deflate.c
|
|
|
|
gzwrite.c
|
|
|
|
trees.c
|
2010-05-04 20:28:34 +00:00
|
|
|
crc32.c
|
|
|
|
gzlib.c
|
2010-06-04 11:07:25 +00:00
|
|
|
infback.c
|
|
|
|
inftrees.c
|
|
|
|
adler32.c
|
|
|
|
gzclose.c
|
|
|
|
gzread.c
|
|
|
|
inffast.c
|
|
|
|
inflate.c
|
|
|
|
uncompr.c
|
2010-05-04 20:28:34 +00:00
|
|
|
zutil.c)
|
2010-01-21 15:12:50 +00:00
|
|
|
|
|
|
|
# variable with all headers of this library
|
|
|
|
set(zlibHeaders
|
2010-06-04 11:07:25 +00:00
|
|
|
gzguts.h
|
|
|
|
inffast.h
|
|
|
|
inflate.h
|
|
|
|
zconf.h
|
2010-05-04 20:28:34 +00:00
|
|
|
zlib.h
|
|
|
|
zutil.h
|
2010-06-04 11:07:25 +00:00
|
|
|
deflate.h
|
|
|
|
inffixed.h
|
2010-05-04 20:28:34 +00:00
|
|
|
trees.h
|
2010-06-04 11:07:25 +00:00
|
|
|
crc32.h
|
2010-05-04 20:28:34 +00:00
|
|
|
inftrees.h )
|
2010-01-21 15:12:50 +00:00
|
|
|
|
|
|
|
# add library
|
|
|
|
add_library(${zlibName} STATIC ${zlibSources} ${zlibHeaders})
|
|
|
|
|
2010-05-16 00:36:42 +00:00
|
|
|
# Force the linker into 32 bits mode
|
|
|
|
target_link_libraries(${zlibName} -m32)
|
|
|
|
|