@@ -4,55 +4,59 @@ target_include_directories(sljit PUBLIC ../thirdparty)
4
4
target_compile_definitions (sljit PUBLIC SLJIT_HAVE_CONFIG_PRE=1 SLJIT_HAVE_CONFIG_POST=1)
5
5
target_compile_options (sljit PRIVATE $<$<COMPILE_LANG_AND_ID:C,AppleClang,Clang,GNU>:-Wno-conditional-uninitialized>)
6
6
7
- # lzma
8
- add_subdirectory (libchdr/deps/lzma-24.05 EXCLUDE_FROM_ALL )
9
- list (APPEND CHDR_LIBS lzma)
10
- list (APPEND CHDR_INCLUDES lzma)
7
+ option (ARES_ENABLE_CHD "Enable CHD format support via libchdr" ON )
11
8
12
- if (OS_MACOS)
13
- option (WITH_SYSTEM_ZLIB "Use system zlib" ON )
14
- endif ()
15
- # zlib
16
- if (WITH_SYSTEM_ZLIB)
17
- find_package (ZLIB REQUIRED)
18
- list (APPEND PLATFORM_LIBS ZLIB::ZLIB)
19
- else ()
20
- option (ZLIB_BUILD_EXAMPLES "Enable Zlib Examples" OFF )
21
- add_subdirectory (libchdr/deps/zlib-1.3.1 EXCLUDE_FROM_ALL )
22
- set_target_properties (
23
- zlibstatic
24
- PROPERTIES POSITION_INDEPENDENT_CODE ON FOLDER thirdparty PREFIX ""
25
- )
26
- list (APPEND CHDR_LIBS zlibstatic)
27
- endif ()
9
+ if (ARES_ENABLE_CHD)
10
+ # lzma
11
+ add_subdirectory (libchdr/deps/lzma-24.05 EXCLUDE_FROM_ALL )
12
+ list (APPEND CHDR_LIBS lzma)
13
+ list (APPEND CHDR_INCLUDES lzma)
28
14
29
- # zstd
30
- option (ZSTD_BUILD_SHARED "BUILD SHARED LIBRARIES" OFF )
31
- option (ZSTD_BUILD_PROGRAMS "BUILD PROGRAMS" OFF )
32
- add_subdirectory (libchdr/deps/zstd-1.5.6/build /cmake EXCLUDE_FROM_ALL )
33
- list (APPEND CHDR_LIBS libzstd_static)
34
- #--------------------------------------------------
35
- # chdr
36
- #--------------------------------------------------
15
+ if (OS_MACOS)
16
+ option (WITH_SYSTEM_ZLIB "Use system zlib" ON )
17
+ endif ()
18
+ # zlib
19
+ if (WITH_SYSTEM_ZLIB)
20
+ find_package (ZLIB REQUIRED)
21
+ list (APPEND PLATFORM_LIBS ZLIB::ZLIB)
22
+ else ()
23
+ option (ZLIB_BUILD_EXAMPLES "Enable Zlib Examples" OFF )
24
+ add_subdirectory (libchdr/deps/zlib-1.3.1 EXCLUDE_FROM_ALL )
25
+ set_target_properties (
26
+ zlibstatic
27
+ PROPERTIES POSITION_INDEPENDENT_CODE ON FOLDER thirdparty PREFIX ""
28
+ )
29
+ list (APPEND CHDR_LIBS zlibstatic)
30
+ endif ()
37
31
38
- set (
39
- CHDR_SOURCES
40
- libchdr/src/libchdr_bitstream.c
41
- libchdr/src/libchdr_cdrom.c
42
- libchdr/src/libchdr_chd.c
43
- libchdr/src/libchdr_flac.c
44
- libchdr/src/libchdr_huffman.c
45
- )
32
+ # zstd
33
+ option (ZSTD_BUILD_SHARED "BUILD SHARED LIBRARIES" OFF )
34
+ option (ZSTD_BUILD_PROGRAMS "BUILD PROGRAMS" OFF )
35
+ add_subdirectory ( libchdr/deps/zstd-1.5.6/ build /cmake EXCLUDE_FROM_ALL )
36
+ list ( APPEND CHDR_LIBS libzstd_static)
37
+ #--------------------------------------------------
38
+ # chdr
39
+ #--------------------------------------------------
46
40
47
- list (APPEND CHDR_INCLUDES ${CMAKE_CURRENT_BINARY_DIR} /libchdr/include )
41
+ set (
42
+ CHDR_SOURCES
43
+ libchdr/src/libchdr_bitstream.c
44
+ libchdr/src/libchdr_cdrom.c
45
+ libchdr/src/libchdr_chd.c
46
+ libchdr/src/libchdr_flac.c
47
+ libchdr/src/libchdr_huffman.c
48
+ )
48
49
49
- add_library (chdr-static STATIC ${CHDR_SOURCES} )
50
- target_include_directories (chdr-static PUBLIC ${CHDR_INCLUDES} PUBLIC libchdr/include )
51
- target_link_libraries (chdr-static PRIVATE ${CHDR_LIBS} ${PLATFORM_LIBS} )
52
- target_compile_options (
53
- chdr-static
54
- PRIVATE $<$<CXX_COMPILER_ID:Clang,AppleClang>:-Wno-unreachable-code -Wno-unused-function>
55
- )
50
+ list (APPEND CHDR_INCLUDES ${CMAKE_CURRENT_BINARY_DIR} /libchdr/include )
51
+
52
+ add_library (chdr-static STATIC ${CHDR_SOURCES} )
53
+ target_include_directories (chdr-static PUBLIC ${CHDR_INCLUDES} PUBLIC libchdr/include )
54
+ target_link_libraries (chdr-static PRIVATE ${CHDR_LIBS} ${PLATFORM_LIBS} )
55
+ target_compile_options (
56
+ chdr-static
57
+ PRIVATE $<$<CXX_COMPILER_ID:Clang,AppleClang>:-Wno-unreachable-code -Wno-unused-function>
58
+ )
59
+ endif ()
56
60
57
61
add_library (
58
62
tzxfile
@@ -100,10 +104,12 @@ target_compile_options(ymfm PRIVATE $<$<CXX_COMPILER_ID:Clang,AppleClang>:-Wno-u
100
104
101
105
set_target_properties (ymfm PROPERTIES FOLDER thirdparty PREFIX "" )
102
106
set_target_properties (tzxfile PROPERTIES FOLDER thirdparty PREFIX "" )
103
- set_target_properties (chdr-static PROPERTIES FOLDER thirdparty PREFIX "" )
104
107
set_target_properties (sljit PROPERTIES FOLDER thirdparty PREFIX "" )
105
- if (NOT WITH_SYSTEM_ZLIB)
106
- set_target_properties (zlib PROPERTIES FOLDER thirdparty PREFIX "" )
108
+ if (ARES_ENABLE_CHD)
109
+ set_target_properties (chdr-static PROPERTIES FOLDER thirdparty PREFIX "" )
110
+ if (NOT WITH_SYSTEM_ZLIB)
111
+ set_target_properties (zlib PROPERTIES FOLDER thirdparty PREFIX "" )
112
+ endif ()
113
+ set_target_properties (lzma PROPERTIES FOLDER thirdparty PREFIX "" )
114
+ set_target_properties (libzstd_static PROPERTIES FOLDER thirdparty PREFIX "" )
107
115
endif ()
108
- set_target_properties (lzma PROPERTIES FOLDER thirdparty PREFIX "" )
109
- set_target_properties (libzstd_static PROPERTIES FOLDER thirdparty PREFIX "" )
0 commit comments