Commit f5f0b43 1 parent c9ac04c commit f5f0b43 Copy full SHA for f5f0b43
File tree 3 files changed +13
-34
lines changed
3 files changed +13
-34
lines changed Original file line number Diff line number Diff line change @@ -403,21 +403,10 @@ IF(WINDOWS_SUPPORT)
403
403
ADD_DEFINITIONS (-DWIN32_LEAN_AND_MEAN)
404
404
ENDIF ()
405
405
406
- SET (SAGITTARIUS_EXT_FEATURES ${PROJECT_BINARY_DIR} /build /src/ext -features.c)
407
-
408
- # sub directory can add features
409
- # FIXME this is ugly
410
- FILE (WRITE ${SAGITTARIUS_EXT_FEATURES}
411
- "#define LIBSAGITTARIUS_BODY
412
- #include <sagittarius/private/core.h>
413
- void Sg__InitExtFeatures()
414
- {
415
- " )
406
+ SET (SAGITTARIUS_EXT_FEATURES ${PROJECT_BINARY_DIR} /ext -features.inc)
407
+
416
408
MACRO (ADD_FEATURE feature)
417
- FILE (APPEND ${SAGITTARIUS_EXT_FEATURES}
418
- "Sg_AddCondFeature(UC(\" ${feature} \" ));\n " )
419
- FILE (APPEND ${SAGITTARIUS_EXT_FEATURES}
420
- "Sg_AddCondFeature(UC(\" sagittarius.${feature} \" ));\n " )
409
+ FILE (APPEND ${SAGITTARIUS_EXT_FEATURES} "EXT_FEATURE(\" ${feature} \" );\n " )
421
410
ENDMACRO ()
422
411
423
412
# Issue #37: Name conflictin with other 'sash'.
@@ -454,10 +443,6 @@ ADD_SUBDIRECTORY(ext ${SAGITTARIUS_EXT_WORK_DIRECTORY})
454
443
# at the bottom of the file.
455
444
ADD_SUBDIRECTORY (cmake build /cmake)
456
445
457
- FILE (APPEND ${SAGITTARIUS_EXT_FEATURES}
458
- "
459
- }" )
460
-
461
446
CONFIGURE_FILE (cmake/sagittarius-config.in
462
447
${PROJECT_BINARY_DIR} /sagittarius-config)
463
448
CONFIGURE_FILE (cmake/sagittarius-package.in
Original file line number Diff line number Diff line change @@ -99,20 +99,7 @@ SET(SAGITTARIUS_LIB_SOURCE
99
99
wrappers.c
100
100
# libraries
101
101
${STUB_SOURCES}
102
- ${BUILTIN_SOURCES}
103
-
104
- # Since we use non builtin library in REPL
105
- # I don't see the reason it need to be builtin
106
- # lib_repl.c
107
- # now match is replaced to Alex Shin's match
108
- #lib_match_core.c
109
- ${SAGITTARIUS_EXT_FEATURES}
110
- )
111
-
112
- # to add features in core
113
- SET_SOURCE_FILES_PROPERTIES (${SAGITTARIUS_EXT_FEATURES}
114
- PROPERTIES
115
- GENERATED TRUE )
102
+ ${BUILTIN_SOURCES} )
116
103
117
104
ADD_LIBRARY (sagittarius SHARED
118
105
${SAGITTARIUS_LIB_SOURCE}
Original file line number Diff line number Diff line change @@ -682,9 +682,16 @@ static void init_cond_features()
682
682
683
683
/* version clause */
684
684
Sg_AddCondFeature (UC ("cond-expand.version" ));
685
-
685
+
686
+ #define EXT_FEATURE (name ) \
687
+ do { \
688
+ Sg_AddCondFeature(UC(name)); \
689
+ Sg_AddCondFeature(UC("sagittarius." name)); \
690
+ } while (0)
691
+
686
692
/* extlib features */
687
- Sg__InitExtFeatures ();
693
+ #include <ext-features.inc>
694
+ #undef EXT_FEATURE
688
695
}
689
696
690
697
/* Starting point of the Sagittarius engine */
You can’t perform that action at this time.
0 commit comments