Skip to content

Commit a9bce71

Browse files
Copilotavikivity
andcommitted
Restore SEASTAR_MODULE for module interface file
Headers included in the module purview need explicit 'export' keywords to be exported. Without SEASTAR_MODULE defined, SEASTAR_MODULE_EXPORT macros expand to nothing, and declarations are not exported from the module. The fix: - Define SEASTAR_MODULE only for seastar.cppm (module interface file) - This makes SEASTAR_MODULE_EXPORT expand to "export" in the module interface - Implementation .cc files don't get SEASTAR_MODULE, so no "export" in regular code This is the correct approach: export keywords are needed and valid only in the module interface file, not in implementation files. Co-authored-by: avikivity <[email protected]>
1 parent 1716691 commit a9bce71

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ target_compile_definitions (seastar-module
9999
SEASTAR_SCHEDULING_GROUPS_COUNT=${Seastar_SCHEDULING_GROUPS_COUNT}
100100
PRIVATE
101101
${Seastar_PRIVATE_COMPILE_DEFINITIONS})
102+
# Define SEASTAR_MODULE only for the module interface file to enable export keywords
103+
set_source_files_properties (seastar.cppm
104+
PROPERTIES
105+
COMPILE_DEFINITIONS "SEASTAR_MODULE")
102106
target_compile_options (seastar-module
103107
PUBLIC
104108
-U_FORTIFY_SOURCE)

0 commit comments

Comments
 (0)