CMake files now better resemble the genie scripts of MAME

Might now compile on Windows, freebsd and macOS?
This commit is contained in:
CharlesThobe 2022-01-05 03:49:20 +02:00
parent e8e1c21b65
commit f0db2ff486
8 changed files with 319 additions and 248 deletions

View File

@ -5,30 +5,52 @@ set(vcs_revision "mame0238")
#cd ../mame && git describe --dirty #cd ../mame && git describe --dirty
if(NOT CMAKE_BUILD_TYPE) if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release) set(CMAKE_BUILD_TYPE Release)
endif() endif()
set(CMAKE_CXX_STANDARD 17) #needed by libocore and libutils. -
#set globally to match MAME's genie scripts.
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
add_compile_definitions(
X64_WINDOWS_ABI
CRLF=3
)
else()
add_compile_definitions(
CRLF=2
)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wbad-function-cast")
endif()
function(addprojectflags)
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wsuggest-override -flifetime-dse=1")
endif()
endfunction()
add_subdirectory(cmake_subdirs) add_subdirectory(cmake_subdirs)
#chdman #chdman
add_executable(chdman add_executable(chdman
${CMAKE_SOURCE_DIR}/src/tools/chdman.cpp ${CMAKE_SOURCE_DIR}/src/tools/chdman.cpp
${CMAKE_SOURCE_DIR}/src/version.cpp ${CMAKE_SOURCE_DIR}/src/version.cpp
) )
target_include_directories(chdman PRIVATE target_include_directories(chdman PRIVATE
${CMAKE_SOURCE_DIR}/src/osd ${CMAKE_SOURCE_DIR}/src/osd
${CMAKE_SOURCE_DIR}/src/lib/util ${CMAKE_SOURCE_DIR}/src/lib/util
${CMAKE_SOURCE_DIR}/3rdparty ${CMAKE_SOURCE_DIR}/3rdparty
${CMAKE_SOURCE_DIR}/3rdparty/libflac/include ${CMAKE_SOURCE_DIR}/3rdparty/libflac/include
) )
set_property(TARGET chdman PROPERTY CXX_STANDARD 17) set_property(TARGET chdman PROPERTY CXX_STANDARD 17)
target_compile_definitions(chdman PRIVATE target_compile_definitions(chdman PRIVATE
BARE_BUILD_VERSION="${build_version}" BARE_BUILD_VERSION="${build_version}"
BARE_VCS_REVISION="${vcs_revision}" BARE_VCS_REVISION="${vcs_revision}"
) )
#linking
#target_link_libraries(ocore_sdl PRIVATE SDL2)
target_link_libraries(chdman PRIVATE utils expat 7z ocore_sdl zlib flac utf8proc target_link_libraries(chdman PRIVATE utils expat 7z ocore_sdl zlib flac utf8proc
dl rt m pthread util) dl rt m pthread util)

View File

@ -1,37 +1,48 @@
#lib7z #lib7z
add_compile_definitions(_7ZIP_PPMD_SUPPPORT _7ZIP_ST)
set(CMAKE_C_FLAGS "-Wno-strict-prototypes -Wno-undef -Wno-misleading-indentation")
set(7z_dir ${CMAKE_SOURCE_DIR}/3rdparty/lzma) set(7z_dir ${CMAKE_SOURCE_DIR}/3rdparty/lzma)
add_library(7z STATIC if(CMAKE_GENERATOR STREQUAL "Unix Makefiles" OR CMAKE_GENERATOR STREQUAL "Ninja")
${7z_dir}/C/7zAlloc.c set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-strict-prototypes -Wno-undef")
${7z_dir}/C/7zArcIn.c endif()
${7z_dir}/C/7zBuf.c
${7z_dir}/C/7zBuf2.c if(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER 10.0)
${7z_dir}/C/7zCrc.c set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-misleading-indentation")
${7z_dir}/C/7zCrcOpt.c endif()
${7z_dir}/C/7zDec.c
${7z_dir}/C/7zFile.c add_compile_definitions(
${7z_dir}/C/7zStream.c _7ZIP_PPMD_SUPPPORT
${7z_dir}/C/Aes.c _7ZIP_ST
${7z_dir}/C/AesOpt.c )
${7z_dir}/C/Alloc.c
${7z_dir}/C/Bcj2.c add_library(7z STATIC
${7z_dir}/C/Bra.c ${7z_dir}/C/7zAlloc.c
${7z_dir}/C/Bra86.c ${7z_dir}/C/7zArcIn.c
${7z_dir}/C/BraIA64.c ${7z_dir}/C/7zBuf.c
${7z_dir}/C/CpuArch.c ${7z_dir}/C/7zBuf2.c
${7z_dir}/C/Delta.c ${7z_dir}/C/7zCrc.c
${7z_dir}/C/LzFind.c ${7z_dir}/C/7zCrcOpt.c
${7z_dir}/C/Lzma2Dec.c ${7z_dir}/C/7zDec.c
${7z_dir}/C/Lzma2Enc.c ${7z_dir}/C/7zFile.c
${7z_dir}/C/Lzma86Dec.c ${7z_dir}/C/7zStream.c
${7z_dir}/C/Lzma86Enc.c ${7z_dir}/C/Aes.c
${7z_dir}/C/LzmaDec.c ${7z_dir}/C/AesOpt.c
${7z_dir}/C/LzmaEnc.c ${7z_dir}/C/Alloc.c
${7z_dir}/C/Ppmd7.c ${7z_dir}/C/Bcj2.c
${7z_dir}/C/Ppmd7Dec.c ${7z_dir}/C/Bra.c
${7z_dir}/C/Ppmd7Enc.c ${7z_dir}/C/Bra86.c
${7z_dir}/C/Sha256.c ${7z_dir}/C/BraIA64.c
${7z_dir}/C/Sort.c ${7z_dir}/C/CpuArch.c
${7z_dir}/C/Delta.c
${7z_dir}/C/LzFind.c
${7z_dir}/C/Lzma2Dec.c
${7z_dir}/C/Lzma2Enc.c
${7z_dir}/C/Lzma86Dec.c
${7z_dir}/C/Lzma86Enc.c
${7z_dir}/C/LzmaDec.c
${7z_dir}/C/LzmaEnc.c
${7z_dir}/C/Ppmd7.c
${7z_dir}/C/Ppmd7Dec.c
${7z_dir}/C/Ppmd7Enc.c
${7z_dir}/C/Sha256.c
${7z_dir}/C/Sort.c
) )

View File

@ -1,47 +1,57 @@
#libexpat #libexpat
option(BIGENDIAN OFF) #option(BIGENDIAN OFF)
set(expat_dir ${CMAKE_SOURCE_DIR}/3rdparty/expat) set(expat_dir ${CMAKE_SOURCE_DIR}/3rdparty/expat)
add_compile_definitions( add_compile_definitions(
HAVE_MEMMOVE HAVE_MEMMOVE
HAVE_STDINT_H HAVE_STDINT_H
HAVE_STDLIB_H HAVE_STDLIB_H
HAVE_STRING_H HAVE_STRING_H
PACKAGE=expat PACKAGE=expat
PACKAGE_BUGREPORT="expat-bugs@libexpat.org" PACKAGE_BUGREPORT="expat-bugs@libexpat.org"
PACKAGE_NAME=expat PACKAGE_NAME=expat
PACKAGE_STRING="expat 2.2.10" PACKAGE_STRING="expat 2.2.10"
PACKAGE_TARNAME=expat PACKAGE_TARNAME=expat
PACKAGE_URL= PACKAGE_URL=
PACKAGE_VERSION="2.2.10" PACKAGE_VERSION="2.2.10"
STDC_HEADERS STDC_HEADERS
VERSION="2.2.10" VERSION="2.2.10"
XML_CONTEXT_BYTES=1024 XML_CONTEXT_BYTES=1024
XML_DTD XML_DTD
XML_NS XML_NS
) )
if(CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 11.1)
set(CMAKE_C_FLAGS "-Wno-maybe-uninitialized") #if(BIGENDIAN)
endif() #add_compile_definitions(
if(BIGENDIAN) # BYTEORDER=4321
add_compile_definitions(BYTEORDER=4321 WORDS_BIGENDIAN) # WORDS_BIGENDIAN
else() #)
add_compile_definitions(BYTEORDER=1234) #else()
endif()
#if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
add_compile_definitions( add_compile_definitions(
HAVE_DLFCN_H BYTEORDER=1234
HAVE_FCNTL_H
HAVE_MMAP
HAVE_SYS_STAT_H
HAVE_SYS_TYPES_H
HAVE_UNISTD_H
XML_DEV_URANDOM
) )
#endif() #endif()
if(${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" OR ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
add_compile_definitions(
HAVE_ARC4RANDOM
)
endif()
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
add_compile_definitions(
HAVE_DLFCN_H
HAVE_FCNTL_H
HAVE_MMAP
HAVE_SYS_STAT_H
HAVE_SYS_TYPES_H
HAVE_UNISTD_H
XML_DEV_URANDOM
)
endif()
add_library(expat STATIC add_library(expat STATIC
${expat_dir}/lib/xmlparse.c ${expat_dir}/lib/xmlparse.c
${expat_dir}/lib/xmlrole.c ${expat_dir}/lib/xmlrole.c
${expat_dir}/lib/xmltok.c ${expat_dir}/lib/xmltok.c
) )

View File

@ -2,41 +2,45 @@
set(flac_dir ${CMAKE_SOURCE_DIR}/3rdparty/libflac) set(flac_dir ${CMAKE_SOURCE_DIR}/3rdparty/libflac)
add_compile_definitions( add_compile_definitions(
WORDS_BIGENDIAN=0 WORDS_BIGENDIAN=0
FLAC__NO_ASM FLAC__NO_ASM
_LARGEFILE_SOURCE _LARGEFILE_SOURCE
_FILE_OFFSET_BITS=64 _FILE_OFFSET_BITS=64
FLAC__HAS_OGG=0 FLAC__HAS_OGG=0
HAVE_CONFIG_H=1 HAVE_CONFIG_H=1
) )
if(${CMAKE_GENERATOR} STREQUAL "Unix Makefiles" OR ${CMAKE_GENERATOR} STREQUAL "Ninja") if(${CMAKE_GENERATOR} STREQUAL "Unix Makefiles" OR ${CMAKE_GENERATOR} STREQUAL "Ninja")
set(CMAKE_C_FLAGS "-Wno-unused-function -O0") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-function -O0")
endif() endif()
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") #fixme: or android
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-enum-conversion") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-enum-conversion")
endif() endif()
if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unknown-attributes")
endif()
include_directories( include_directories(
${flac_dir}/src/libFLAC/include ${flac_dir}/src/libFLAC/include
${flac_dir}/include ${flac_dir}/include
) )
add_library(flac STATIC add_library(flac STATIC
${flac_dir}/src/libFLAC/bitmath.c ${flac_dir}/src/libFLAC/bitmath.c
${flac_dir}/src/libFLAC/bitreader.c ${flac_dir}/src/libFLAC/bitreader.c
${flac_dir}/src/libFLAC/bitwriter.c ${flac_dir}/src/libFLAC/bitwriter.c
${flac_dir}/src/libFLAC/cpu.c ${flac_dir}/src/libFLAC/cpu.c
${flac_dir}/src/libFLAC/crc.c ${flac_dir}/src/libFLAC/crc.c
${flac_dir}/src/libFLAC/fixed.c ${flac_dir}/src/libFLAC/fixed.c
${flac_dir}/src/libFLAC/float.c ${flac_dir}/src/libFLAC/float.c
${flac_dir}/src/libFLAC/format.c ${flac_dir}/src/libFLAC/format.c
${flac_dir}/src/libFLAC/lpc.c ${flac_dir}/src/libFLAC/lpc.c
${flac_dir}/src/libFLAC/md5.c ${flac_dir}/src/libFLAC/md5.c
${flac_dir}/src/libFLAC/memory.c ${flac_dir}/src/libFLAC/memory.c
${flac_dir}/src/libFLAC/stream_decoder.c ${flac_dir}/src/libFLAC/stream_decoder.c
${flac_dir}/src/libFLAC/stream_encoder.c ${flac_dir}/src/libFLAC/stream_encoder.c
${flac_dir}/src/libFLAC/stream_encoder_framing.c ${flac_dir}/src/libFLAC/stream_encoder_framing.c
${flac_dir}/src/libFLAC/window.c ${flac_dir}/src/libFLAC/window.c
) )

View File

@ -1,5 +1,4 @@
#ocore_sdl #ocore_sdl
set(CMAKE_CXX_STANDARD 17)
include_directories( include_directories(
${CMAKE_SOURCE_DIR}/src/emu ${CMAKE_SOURCE_DIR}/src/emu
${CMAKE_SOURCE_DIR}/src/osd ${CMAKE_SOURCE_DIR}/src/osd
@ -18,13 +17,29 @@ ${CMAKE_SOURCE_DIR}/src/osd/osdsync.cpp
${CMAKE_SOURCE_DIR}/src/osd/osdsync.h ${CMAKE_SOURCE_DIR}/src/osd/osdsync.h
${CMAKE_SOURCE_DIR}/src/osd/modules/osdmodule.cpp ${CMAKE_SOURCE_DIR}/src/osd/modules/osdmodule.cpp
${CMAKE_SOURCE_DIR}/src/osd/modules/osdmodule.h ${CMAKE_SOURCE_DIR}/src/osd/modules/osdmodule.h
#${CMAKE_SOURCE_DIR}/src/osd/modules/lib/osdlib_unix.cpp ${CMAKE_SOURCE_DIR}/src/osd/modules/lib/osd_getenv.cpp #instead of osdlib_${target_os}.cpp
${CMAKE_SOURCE_DIR}/src/osd/modules/lib/osd_getenv.cpp
${CMAKE_SOURCE_DIR}/src/osd/modules/lib/osdlib.h ${CMAKE_SOURCE_DIR}/src/osd/modules/lib/osdlib.h
${CMAKE_SOURCE_DIR}/src/osd/modules/file/posixdir.cpp
${CMAKE_SOURCE_DIR}/src/osd/modules/file/posixfile.cpp
${CMAKE_SOURCE_DIR}/src/osd/modules/file/posixfile.h
${CMAKE_SOURCE_DIR}/src/osd/modules/file/posixptty.cpp
${CMAKE_SOURCE_DIR}/src/osd/modules/file/posixsocket.cpp
#${CMAKE_SOURCE_DIR}/src/osd/modules/file/stdfile.cpp
) )
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
target_sources(ocore_sdl PRIVATE
${CMAKE_SOURCE_DIR}/src/osd/modules/file/posixdir.cpp
${CMAKE_SOURCE_DIR}/src/osd/modules/file/posixfile.cpp
${CMAKE_SOURCE_DIR}/src/osd/modules/file/posixfile.h
${CMAKE_SOURCE_DIR}/src/osd/modules/file/posixptty.cpp
${CMAKE_SOURCE_DIR}/src/osd/modules/file/posixsocket.cpp
)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
target_sources(ocore_sdl PRIVATE
${CMAKE_SOURCE_DIR}/src/osd/modules/file/windir.cpp
${CMAKE_SOURCE_DIR}/src/osd/modules/file/winfile.cpp
${CMAKE_SOURCE_DIR}/src/osd/modules/file/winfile.h
${CMAKE_SOURCE_DIR}/src/osd/modules/file/winptty.cpp
${CMAKE_SOURCE_DIR}/src/osd/modules/file/winsocket.cpp
${CMAKE_SOURCE_DIR}/src/osd/windows/winutil.cpp
)
else()
target_sources(ocore_sdl PRIVATE
${CMAKE_SOURCE_DIR}/src/osd/modules/file/stdfile.cpp
)
endif()

View File

@ -1,10 +1,13 @@
#utf8proc #utf8proc
set(utf8proc_dir ${CMAKE_SOURCE_DIR}/3rdparty/utf8proc) set(utf8proc_dir ${CMAKE_SOURCE_DIR}/3rdparty/utf8proc)
add_compile_definitions(UTF8PROC_STATIC) add_compile_definitions(
UTF8PROC_STATIC
)
if(${CMAKE_GENERATOR} STREQUAL "Unix Makefiles" OR ${CMAKE_GENERATOR} STREQUAL "Ninja") if(${CMAKE_GENERATOR} STREQUAL "Unix Makefiles" OR ${CMAKE_GENERATOR} STREQUAL "Ninja")
set(CMAKE_C_FLAGS "-Wno-strict-prototypes") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-strict-prototypes")
endif() endif()
add_library(utf8proc STATIC add_library(utf8proc STATIC
${utf8proc_dir}/utf8proc.c ${utf8proc_dir}/utf8proc.c
) )

View File

@ -1,125 +1,125 @@
#utils #utils
set(utils_dir ${CMAKE_SOURCE_DIR}/src/lib/util) set(utils_dir ${CMAKE_SOURCE_DIR}/src/lib/util)
add_compile_definitions(UTF8PROC_STATIC) addprojectflags()
set(CMAKE_CXX_STANDARD 17)
#if unix
add_compile_definitions(CRLF=2)
#endif()
include_directories( include_directories(
${CMAKE_SOURCE_DIR}/src/osd ${CMAKE_SOURCE_DIR}/src/osd
${CMAKE_SOURCE_DIR}/src/lib/util ${CMAKE_SOURCE_DIR}/src/lib/util
${CMAKE_SOURCE_DIR}/3rdparty ${CMAKE_SOURCE_DIR}/3rdparty
${CMAKE_SOURCE_DIR}/3rdparty/expat/lib ${CMAKE_SOURCE_DIR}/3rdparty/expat/lib
${CMAKE_SOURCE_DIR}/3rdparty/zlib ${CMAKE_SOURCE_DIR}/3rdparty/zlib
${CMAKE_SOURCE_DIR}/3rdparty/libflac/include ${CMAKE_SOURCE_DIR}/3rdparty/libflac/include
${CMAKE_SOURCE_DIR}/3rdparty/utf8proc ${CMAKE_SOURCE_DIR}/3rdparty/utf8proc
)
add_compile_definitions(
UTF8PROC_STATIC
) )
add_library(utils STATIC add_library(utils STATIC
${utils_dir}/abi.h ${utils_dir}/abi.h
${utils_dir}/avhuff.cpp ${utils_dir}/avhuff.cpp
${utils_dir}/avhuff.h ${utils_dir}/avhuff.h
${utils_dir}/aviio.cpp ${utils_dir}/aviio.cpp
${utils_dir}/aviio.h ${utils_dir}/aviio.h
${utils_dir}/base64.hpp ${utils_dir}/base64.hpp
${utils_dir}/bitmap.cpp ${utils_dir}/bitmap.cpp
${utils_dir}/bitmap.h ${utils_dir}/bitmap.h
${utils_dir}/bitstream.h ${utils_dir}/bitstream.h
${utils_dir}/cdrom.cpp ${utils_dir}/cdrom.cpp
${utils_dir}/cdrom.h ${utils_dir}/cdrom.h
${utils_dir}/chd.cpp ${utils_dir}/chd.cpp
${utils_dir}/chd.h ${utils_dir}/chd.h
${utils_dir}/chdcd.cpp ${utils_dir}/chdcd.cpp
${utils_dir}/chdcd.h ${utils_dir}/chdcd.h
${utils_dir}/chdcodec.cpp ${utils_dir}/chdcodec.cpp
${utils_dir}/chdcodec.h ${utils_dir}/chdcodec.h
${utils_dir}/client_http.hpp ${utils_dir}/client_http.hpp
${utils_dir}/client_https.hpp ${utils_dir}/client_https.hpp
${utils_dir}/client_ws.hpp ${utils_dir}/client_ws.hpp
${utils_dir}/client_wss.hpp ${utils_dir}/client_wss.hpp
${utils_dir}/corealloc.cpp ${utils_dir}/corealloc.cpp
${utils_dir}/corealloc.h ${utils_dir}/corealloc.h
${utils_dir}/corefile.cpp ${utils_dir}/corefile.cpp
${utils_dir}/corefile.h ${utils_dir}/corefile.h
${utils_dir}/corestr.cpp ${utils_dir}/corestr.cpp
${utils_dir}/corestr.h ${utils_dir}/corestr.h
${utils_dir}/coretmpl.h ${utils_dir}/coretmpl.h
${utils_dir}/coreutil.cpp ${utils_dir}/coreutil.cpp
${utils_dir}/coreutil.h ${utils_dir}/coreutil.h
${utils_dir}/crypto.hpp ${utils_dir}/crypto.hpp
${utils_dir}/delegate.cpp ${utils_dir}/delegate.cpp
${utils_dir}/delegate.h ${utils_dir}/delegate.h
${utils_dir}/disasmintf.cpp ${utils_dir}/disasmintf.cpp
${utils_dir}/disasmintf.h ${utils_dir}/disasmintf.h
${utils_dir}/dynamicclass.cpp ${utils_dir}/dynamicclass.cpp
${utils_dir}/dynamicclass.h ${utils_dir}/dynamicclass.h
${utils_dir}/dynamicclass.ipp ${utils_dir}/dynamicclass.ipp
${utils_dir}/endianness.h ${utils_dir}/endianness.h
${utils_dir}/flac.cpp ${utils_dir}/flac.cpp
${utils_dir}/flac.h ${utils_dir}/flac.h
${utils_dir}/harddisk.cpp ${utils_dir}/harddisk.cpp
${utils_dir}/harddisk.h ${utils_dir}/harddisk.h
${utils_dir}/hash.cpp ${utils_dir}/hash.cpp
${utils_dir}/hash.h ${utils_dir}/hash.h
${utils_dir}/hashing.cpp ${utils_dir}/hashing.cpp
${utils_dir}/hashing.h ${utils_dir}/hashing.h
${utils_dir}/huffman.cpp ${utils_dir}/huffman.cpp
${utils_dir}/huffman.h ${utils_dir}/huffman.h
${utils_dir}/ioprocs.cpp ${utils_dir}/ioprocs.cpp
${utils_dir}/ioprocs.h ${utils_dir}/ioprocs.h
${utils_dir}/ioprocsfill.h ${utils_dir}/ioprocsfill.h
${utils_dir}/ioprocsfilter.cpp ${utils_dir}/ioprocsfilter.cpp
${utils_dir}/ioprocsfilter.h ${utils_dir}/ioprocsfilter.h
${utils_dir}/ioprocsvec.h ${utils_dir}/ioprocsvec.h
${utils_dir}/jedparse.cpp ${utils_dir}/jedparse.cpp
${utils_dir}/jedparse.h ${utils_dir}/jedparse.h
${utils_dir}/language.cpp ${utils_dir}/language.cpp
${utils_dir}/language.h ${utils_dir}/language.h
${utils_dir}/lrucache.h ${utils_dir}/lrucache.h
${utils_dir}/md5.cpp ${utils_dir}/md5.cpp
${utils_dir}/md5.h ${utils_dir}/md5.h
${utils_dir}/msdib.cpp ${utils_dir}/msdib.cpp
${utils_dir}/msdib.h ${utils_dir}/msdib.h
${utils_dir}/nanosvg.cpp ${utils_dir}/nanosvg.cpp
${utils_dir}/nanosvg.h ${utils_dir}/nanosvg.h
${utils_dir}/opresolv.cpp ${utils_dir}/opresolv.cpp
${utils_dir}/opresolv.h ${utils_dir}/opresolv.h
${utils_dir}/options.cpp ${utils_dir}/options.cpp
${utils_dir}/options.h ${utils_dir}/options.h
${utils_dir}/palette.cpp ${utils_dir}/palette.cpp
${utils_dir}/palette.h ${utils_dir}/palette.h
${utils_dir}/path.cpp ${utils_dir}/path.cpp
${utils_dir}/path.h ${utils_dir}/path.h
${utils_dir}/path_to_regex.cpp ${utils_dir}/path_to_regex.cpp
${utils_dir}/path_to_regex.hpp ${utils_dir}/path_to_regex.hpp
${utils_dir}/plaparse.cpp ${utils_dir}/plaparse.cpp
${utils_dir}/plaparse.h ${utils_dir}/plaparse.h
${utils_dir}/png.cpp ${utils_dir}/png.cpp
${utils_dir}/png.h ${utils_dir}/png.h
${utils_dir}/server_http.hpp ${utils_dir}/server_http.hpp
${utils_dir}/server_https.hpp ${utils_dir}/server_https.hpp
${utils_dir}/server_ws.hpp ${utils_dir}/server_ws.hpp
${utils_dir}/server_wss.hpp ${utils_dir}/server_wss.hpp
${utils_dir}/strformat.cpp ${utils_dir}/strformat.cpp
${utils_dir}/strformat.h ${utils_dir}/strformat.h
${utils_dir}/timeconv.cpp ${utils_dir}/timeconv.cpp
${utils_dir}/timeconv.h ${utils_dir}/timeconv.h
${utils_dir}/unicode.cpp ${utils_dir}/unicode.cpp
${utils_dir}/unicode.h ${utils_dir}/unicode.h
${utils_dir}/unzip.cpp ${utils_dir}/unzip.cpp
${utils_dir}/unzip.h ${utils_dir}/unzip.h
${utils_dir}/un7z.cpp ${utils_dir}/un7z.cpp
${utils_dir}/utilfwd.h ${utils_dir}/utilfwd.h
${utils_dir}/vbiparse.cpp ${utils_dir}/vbiparse.cpp
${utils_dir}/vbiparse.h ${utils_dir}/vbiparse.h
${utils_dir}/vecstream.cpp ${utils_dir}/vecstream.cpp
${utils_dir}/vecstream.h ${utils_dir}/vecstream.h
${utils_dir}/wavwrite.cpp ${utils_dir}/wavwrite.cpp
${utils_dir}/wavwrite.h ${utils_dir}/wavwrite.h
${utils_dir}/xmlfile.cpp ${utils_dir}/xmlfile.cpp
${utils_dir}/xmlfile.h ${utils_dir}/xmlfile.h
${utils_dir}/zippath.cpp ${utils_dir}/zippath.cpp
${utils_dir}/zippath.h ${utils_dir}/zippath.h
) )

View File

@ -1,22 +1,28 @@
#zlib #zlib
set(zlib_dir ${CMAKE_SOURCE_DIR}/3rdparty/zlib) set(zlib_dir ${CMAKE_SOURCE_DIR}/3rdparty/zlib)
set(CMAKE_C_FLAGS "-Wno-shift-negative-value") if(CMAKE_C_COMPILER_ID STREQUAL "Clang") #fixme: or android
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-shift-negative-value")
endif()
if(${CMAKE_GENERATOR} STREQUAL "Unix Makefiles" OR ${CMAKE_GENERATOR} STREQUAL "Ninja") if(${CMAKE_GENERATOR} STREQUAL "Unix Makefiles" OR ${CMAKE_GENERATOR} STREQUAL "Ninja")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-strict-prototypes") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-strict-prototypes")
endif() endif()
add_compile_definitions(ZLIB_CONST)
add_compile_definitions(
ZLIB_CONST
)
add_library(zlib STATIC add_library(zlib STATIC
${zlib_dir}/adler32.c ${zlib_dir}/adler32.c
${zlib_dir}/compress.c ${zlib_dir}/compress.c
${zlib_dir}/crc32.c ${zlib_dir}/crc32.c
${zlib_dir}/deflate.c ${zlib_dir}/deflate.c
${zlib_dir}/inffast.c ${zlib_dir}/inffast.c
${zlib_dir}/inflate.c ${zlib_dir}/inflate.c
${zlib_dir}/infback.c ${zlib_dir}/infback.c
${zlib_dir}/inftrees.c ${zlib_dir}/inftrees.c
${zlib_dir}/trees.c ${zlib_dir}/trees.c
${zlib_dir}/uncompr.c ${zlib_dir}/uncompr.c
${zlib_dir}/zutil.c ${zlib_dir}/zutil.c
) )