Skip to content

Commit b389ae6

Browse files
committed
removed experimental-library flag, cmake 3.28 changes, temporary no module for System
1 parent b635776 commit b389ae6

File tree

11 files changed

+26
-22
lines changed

11 files changed

+26
-22
lines changed

CMakeLists.txt

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
cmake_minimum_required(VERSION 3.26)
2+
# enable scan imports in 3.28 while supporting 3.26
3+
cmake_policy(SET CMP0155 NEW)
24

35
# project / version
46
set(REDUMPER_PROJECT_NAME "redumper" CACHE STRING "Project name")
@@ -49,22 +51,24 @@ endif()
4951
# C/C++
5052
set(CMAKE_CXX_STANDARD 20)
5153
set(CMAKE_CXX_STANDARD_REQUIRED ON)
52-
set(CMAKE_CXX_EXTENSIONS OFF)
53-
if(CMAKE_VERSION VERSION_LESS "3.27.0")
54-
set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "2182bf5c-ef0d-489a-91da-49dbc3090d2a")
55-
else()
56-
set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "aa1f7df0-828a-4fcd-9afc-2dc80491aca7")
54+
if(CMAKE_VERSION VERSION_LESS "3.28.0")
55+
set(CMAKE_CXX_EXTENSIONS OFF)
56+
if(CMAKE_VERSION VERSION_LESS "3.27.0")
57+
set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "2182bf5c-ef0d-489a-91da-49dbc3090d2a")
58+
else()
59+
set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "aa1f7df0-828a-4fcd-9afc-2dc80491aca7")
60+
endif()
61+
set(CMAKE_EXPERIMENTAL_CXX_MODULE_DYNDEP 1)
5762
endif()
58-
set(CMAKE_EXPERIMENTAL_CXX_MODULE_DYNDEP 1)
5963
add_definitions(-DREDUMPER_VERSION_MAJOR=${PROJECT_VERSION_MAJOR}
6064
-DREDUMPER_VERSION_MINOR=${PROJECT_VERSION_MINOR}
6165
-DREDUMPER_VERSION_PATCH=${PROJECT_VERSION_PATCH}
6266
-DREDUMPER_VERSION_BUILD=${REDUMPER_VERSION_BUILD})
6367

6468
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
6569
# -fexperimental-library is required for clang-16 as std::format is defined there
66-
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-stdlib=libc++> -fexperimental-library)
67-
add_link_options(-stdlib=libc++ ${REDUMPER_CLANG_LINK_OPTIONS} -fexperimental-library)
70+
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-stdlib=libc++>)
71+
add_link_options(-stdlib=libc++ ${REDUMPER_CLANG_LINK_OPTIONS})
6872

6973
# silence implicit modules use warning
7074
# TL;DR, this will be taken cared of by listing module dependencies explicitly (cmake)
@@ -116,6 +120,7 @@ target_sources(redumper
116120
"dvd/css/css_tables.cc"
117121
"main.cc"
118122
"driveoffsets.txt"
123+
"systems/system.hh"
119124
"utils/throw_line.hh"
120125
"redumper.manifest"
121126
${DRIVEOFFSETS_FN}
@@ -161,7 +166,6 @@ target_sources(redumper
161166
"systems/psx.ixx"
162167
"systems/ps2.ixx"
163168
"systems/sat.ixx"
164-
"systems/system.ixx"
165169
"systems/systems.ixx"
166170
"utils/animation.ixx"
167171
"utils/endian.ixx"

info.ixx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ module;
66
#include <string>
77
#include <utility>
88
#include <sstream>
9+
#include "systems/system.hh"
910
#include "throw_line.hh"
1011

1112
export module info;
@@ -18,7 +19,6 @@ import readers.image_bin_form1_reader;
1819
import readers.image_iso_form1_reader;
1920
import readers.image_raw_reader;
2021
import readers.sector_reader;
21-
import systems.system;
2222
import systems.systems;
2323
import utils.hex_bin;
2424
import utils.logger;

systems/mcd.ixx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ module;
1010
#include <set>
1111
#include <string_view>
1212
#include <vector>
13+
#include "system.hh"
1314

1415
export module systems.mcd;
1516

1617
import filesystem.iso9660;
1718
import readers.sector_reader;
18-
import systems.system;
1919
import utils.hex_bin;
2020
import utils.misc;
2121
import utils.strings;

systems/ps2.ixx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ module;
77
#include <ostream>
88
#include <regex>
99
#include <set>
10+
#include "system.hh"
1011
#include "throw_line.hh"
1112

1213
export module systems.ps2;
1314

1415
import filesystem.iso9660;
1516
import readers.sector_reader;
16-
import systems.system;
1717
import utils.misc;
1818
import utils.strings;
1919

systems/psx.ixx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ module;
55
#include <ostream>
66
#include <regex>
77
#include <set>
8+
#include "system.hh"
89
#include "throw_line.hh"
910

1011
export module systems.psx;
@@ -15,7 +16,6 @@ import cd.subcode;
1516
import dump;
1617
import filesystem.iso9660;
1718
import readers.sector_reader;
18-
import systems.system;
1919
import utils.endian;
2020
import utils.file_io;
2121
import utils.misc;

systems/s_cdrom.ixx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ module;
44
#include <fstream>
55
#include <ostream>
66
#include <vector>
7+
#include "system.hh"
78
#include "throw_line.hh"
89

910
export module systems.cdrom;
@@ -13,7 +14,6 @@ import cd.cdrom;
1314
import cd.ecc;
1415
import cd.edc;
1516
import readers.sector_reader;
16-
import systems.system;
1717
import utils.file_io;
1818

1919

systems/s_iso.ixx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ module;
44
#include <format>
55
#include <fstream>
66
#include <ostream>
7+
#include "system.hh"
78

89
export module systems.iso;
910

1011
import filesystem.iso9660;
1112
import readers.sector_reader;
12-
import systems.system;
1313
import utils.hex_bin;
1414
import utils.strings;
1515

systems/sat.ixx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ module;
66
#include <format>
77
#include <ostream>
88
#include <string_view>
9+
#include "system.hh"
910

1011
export module systems.sat;
1112

1213
import filesystem.iso9660;
1314
import readers.sector_reader;
14-
import systems.system;
1515
import utils.hex_bin;
1616

1717

systems/securom.ixx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ module;
44
#include <fstream>
55
#include <ostream>
66
#include <vector>
7+
#include "system.hh"
78
#include "throw_line.hh"
89

910

@@ -16,7 +17,6 @@ import cd.subcode;
1617
import crc.crc16_gsm;
1718
import dump;
1819
import readers.sector_reader;
19-
import systems.system;
2020
import utils.endian;
2121
import utils.file_io;
2222
import utils.misc;

systems/system.ixx renamed to systems/system.hh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
module;
21
#include <filesystem>
32
#include <ostream>
43
#include <string>
54

6-
export module systems.system;
5+
76

87
import readers.sector_reader;
98

@@ -12,7 +11,8 @@ import readers.sector_reader;
1211
namespace gpsxre
1312
{
1413

15-
export class System
14+
//FIXME: switch back to module after correction of CMake Ninja generator issue with cyclic dependencies
15+
class System
1616
{
1717
public:
1818
enum class Type

0 commit comments

Comments
 (0)