Skip to content

Commit acc578d

Browse files
Merge pull request #374 from deniskoronchik/templates
Implement new template API
2 parents f0d0c15 + 9297ce2 commit acc578d

File tree

74 files changed

+3579
-2506
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+3579
-2506
lines changed

.github/workflows/main.yml

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,53 @@ jobs:
4141
matrix:
4242
config:
4343
- {
44-
name: "Ubuntu latest, GCC",
44+
name: "Ubuntu latest, GCC, Debug",
4545
os: ubuntu-latest,
4646
build_type: "Debug",
47+
sanitizer: "none",
4748
cc: "gcc",
4849
cxx: "g++"
4950
}
5051
- {
5152
name: "Ubuntu latest, GCC, Release",
5253
os: ubuntu-latest,
5354
build_type: "Release",
55+
sanitizer: "none",
5456
cc: "gcc",
5557
cxx: "g++"
5658
}
59+
- {
60+
name: "Ubuntu latest, Clang, Debug",
61+
os: ubuntu-latest,
62+
build_type: "Debug",
63+
sanitizer: "none",
64+
cc: "clang",
65+
cxx: "clang++"
66+
}
67+
- {
68+
name: "Ubuntu latest, Clang, Release",
69+
os: ubuntu-latest,
70+
build_type: "Release",
71+
sanitizer: "none",
72+
cc: "clang",
73+
cxx: "clang++"
74+
}
75+
- {
76+
name: "Ubuntu latest, Clang, Sanitizer - address",
77+
os: ubuntu-latest,
78+
build_type: "Release",
79+
sanitizer: "address",
80+
cc: "clang",
81+
cxx: "clang++"
82+
}
83+
- {
84+
name: "Ubuntu latest, Clang, Sanitizer - memory",
85+
os: ubuntu-latest,
86+
build_type: "Release",
87+
sanitizer: "memory",
88+
cc: "clang",
89+
cxx: "clang++"
90+
}
5791

5892
steps:
5993
- name: Checkout
@@ -71,6 +105,7 @@ jobs:
71105
CC: ${{ matrix.config.cc }}
72106
CCX: ${{ matrix.config.cxx }}
73107
BUILD_TYPE: ${{ matrix.config.build_type }}
108+
SANITIZER_TYPE: $${{ matrix.config.sanitizer }}
74109
run: scripts/ci/install-tests.sh
75110

76111
- name: Run tests

CMakeLists.txt

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ option (SC_BUILD_SCTP "Flag to turn on/off sctp protocol support" OFF)
1616
set(SC_USE_SANITIZER "none" CACHE STRING "Build with specified sanitizer")
1717
set_property(CACHE SC_USE_SANITIZER PROPERTY STRINGS none address memory)
1818

19+
message ("Sanitizer: ${SC_USE_SANITIZER}")
1920

2021
# codegen
2122
if (${UNIX})
@@ -52,22 +53,22 @@ elseif (${SC_USE_SANITIZER} STREQUAL "memory")
5253
endif()
5354

5455
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
55-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcolor-diagnostics -std=c++14")
56+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcolor-diagnostics -std=c++17")
5657
if (${SC_USE_SANITIZER} STREQUAL "none")
5758
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")
5859
endif()
59-
60+
6061
if(${SC_AUTO_TEST})
6162
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wdeprecated-declarations")
6263
endif()
6364
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
64-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wall")
65+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -Wall")
6566
if (${SC_USE_SANITIZER} STREQUAL "none")
6667
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3") ## Optimize
6768
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -s") ## Strip binary
6869
endif()
6970
elseif (NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
70-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
71+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
7172
endif ()
7273

7374
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSC_DEBUG -DSC_PROFILE")
@@ -79,10 +80,6 @@ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG")
7980
message ("CMAKE_C_FLAGS: ${CMAKE_C_FLAGS}")
8081
message ("CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
8182

82-
if (${SC_AUTO_TEST})
83-
add_definitions(-DSC_BUILD_AUTO_TESTS)
84-
endif()
85-
8683
# find dependencies
8784
if (${APPLE})
8885
set(Boost_USE_STATIC_LIBS ON)
@@ -215,6 +212,3 @@ add_subdirectory(${SC_MACHINE_ROOT}/tools)
215212
if (${SC_BUILD_SCTP})
216213
add_subdirectory(${SC_MACHINE_ROOT}/sc-network)
217214
endif()
218-
219-
220-

docs/changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
- Fix issues with alias support in SCs-text (#350, #333)
1515
- Add performance benchmarks
1616
- Fix issues with assigning empty content to `sc-link` (#342, #343)
17+
- Introduce new Template API #374
1718

1819
- **Python**:
1920
- Python modules support removed. [More details](https://github.com/ostis-dev/sc-machine/issues/378)

docs/cpp/cpp-meta.md

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -154,23 +154,6 @@ static ScAddr m_device;
154154
</td>
155155
</tr>
156156
157-
<tr>
158-
<td><strong>Template</strong></td>
159-
<td>
160-
<strong>Arguments:</strong>
161-
<ul>
162-
<li>String system identifier of template sc-structure in sc-memory</li>
163-
</ul>
164-
Specify that this member is a template. After module starts, this template will be parsed from sc-memory. So you will be able use it to search/generate constructions.
165-
<br/>You can use this property just for members that has <strong>ScTemplate</strong> type.
166-
<hr/>
167-
<pre><code class="cpp hljs">
168-
SC_PROPERTY(Template("test_template"))
169-
ScTemplate m_testTemplate;
170-
</code></pre>
171-
</td>
172-
</tr>
173-
174157
<tr>
175158
<td><strong>ForceCreate</strong></td>
176159
<td>

0 commit comments

Comments
 (0)