Skip to content

Commit 74070b1

Browse files
authored
Introduce a new src/output module (#500)
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
1 parent f6a4e39 commit 74070b1

30 files changed

Lines changed: 493 additions & 384 deletions

.github/workflows/website-build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
-DCMAKE_BUILD_TYPE:STRING=Release
1919
-DBLAZE_COMPILER:BOOL=OFF
2020
-DBLAZE_EVALUATOR:BOOL=OFF
21+
-DBLAZE_OUTPUT:BOOL=OFF
2122
-DBLAZE_LINTER:BOOL=OFF
2223
-DBLAZE_TESTS:BOOL=OFF
2324
-DBLAZE_DOCS:BOOL=ON

.github/workflows/website-deploy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
-DCMAKE_BUILD_TYPE:STRING=Release
3030
-DBLAZE_COMPILER:BOOL=OFF
3131
-DBLAZE_EVALUATOR:BOOL=OFF
32+
-DBLAZE_OUTPUT:BOOL=OFF
3233
-DBLAZE_LINTER:BOOL=OFF
3334
-DBLAZE_TESTS:BOOL=OFF
3435
-DBLAZE_DOCS:BOOL=ON

CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
77
# Options
88
option(BLAZE_COMPILER "Build the Blaze compiler library" ON)
99
option(BLAZE_EVALUATOR "Build the Blaze evaluator library" ON)
10+
option(BLAZE_OUTPUT "Build the Blaze output formats library" ON)
1011
option(BLAZE_LINTER "Build the Blaze linter rule library" ON)
1112
option(BLAZE_TESTS "Build the Blaze tests" OFF)
1213
option(BLAZE_BENCHMARK "Build the Blaze benchmarks" OFF)
@@ -48,6 +49,10 @@ if(BLAZE_EVALUATOR)
4849
add_subdirectory(src/evaluator)
4950
endif()
5051

52+
if(BLAZE_OUTPUT)
53+
add_subdirectory(src/output)
54+
endif()
55+
5156
if(BLAZE_LINTER)
5257
add_subdirectory(src/linter)
5358
endif()
@@ -87,6 +92,10 @@ if(BLAZE_TESTS)
8792
add_subdirectory(test/evaluator)
8893
endif()
8994

95+
if(BLAZE_OUTPUT)
96+
add_subdirectory(test/output)
97+
endif()
98+
9099
if(BLAZE_LINTER)
91100
add_subdirectory(test/linter)
92101
endif()

config.cmake.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ list(APPEND BLAZE_COMPONENTS ${blaze_FIND_COMPONENTS})
66
if(NOT BLAZE_COMPONENTS)
77
list(APPEND BLAZE_COMPONENTS compiler)
88
list(APPEND BLAZE_COMPONENTS evaluator)
9+
list(APPEND BLAZE_COMPONENTS output)
910
list(APPEND BLAZE_COMPONENTS linter)
1011
endif()
1112

@@ -21,7 +22,11 @@ foreach(component ${BLAZE_COMPONENTS})
2122
elseif(component STREQUAL "linter")
2223
include("${CMAKE_CURRENT_LIST_DIR}/sourcemeta_blaze_evaluator.cmake")
2324
include("${CMAKE_CURRENT_LIST_DIR}/sourcemeta_blaze_compiler.cmake")
25+
include("${CMAKE_CURRENT_LIST_DIR}/sourcemeta_blaze_output.cmake")
2426
include("${CMAKE_CURRENT_LIST_DIR}/sourcemeta_blaze_linter.cmake")
27+
elseif(component STREQUAL "output")
28+
include("${CMAKE_CURRENT_LIST_DIR}/sourcemeta_blaze_evaluator.cmake")
29+
include("${CMAKE_CURRENT_LIST_DIR}/sourcemeta_blaze_output.cmake")
2530
else()
2631
message(FATAL_ERROR "Unknown Blaze component: ${component}")
2732
endif()

contrib/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ if(BLAZE_COMPILER AND BLAZE_EVALUATOR)
3333
PRIVATE sourcemeta::blaze::compiler)
3434
target_link_libraries(sourcemeta_blaze_contrib_trace
3535
PRIVATE sourcemeta::blaze::evaluator)
36+
target_link_libraries(sourcemeta_blaze_contrib_trace
37+
PRIVATE sourcemeta::blaze::output)
3638

3739
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
3840
sourcemeta_executable(NAMESPACE sourcemeta PROJECT blaze NAME contrib_perf

contrib/trace.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include <sourcemeta/blaze/compiler.h>
55
#include <sourcemeta/blaze/evaluator.h>
6+
#include <sourcemeta/blaze/output.h>
67

78
#include <algorithm> // std::sort, std::max
89
#include <cstdlib> // EXIT_SUCCESS, EXIT_FAILURE

src/compiler/CMakeLists.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
sourcemeta_library(NAMESPACE sourcemeta PROJECT blaze NAME compiler
22
FOLDER "Blaze/Compiler"
3-
PRIVATE_HEADERS error.h output.h unevaluated.h
3+
PRIVATE_HEADERS error.h unevaluated.h
44
SOURCES
55
compile.cc compile_json.cc
66
compile_helpers.h default_compiler.cc unevaluated.cc
7-
compile_output_simple.cc
8-
compile_output_trace.cc
9-
compile_output_standard.cc
107
default_compiler_2020_12.h
118
default_compiler_2019_09.h
129
default_compiler_draft7.h

src/compiler/include/sourcemeta/blaze/compiler.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#endif
77

88
#include <sourcemeta/blaze/compiler_error.h>
9-
#include <sourcemeta/blaze/compiler_output.h>
109
#include <sourcemeta/blaze/compiler_unevaluated.h>
1110

1211
#include <sourcemeta/blaze/evaluator.h>

0 commit comments

Comments
 (0)