Skip to content

Commit 9c1315d

Browse files
authored
Merge pull request #25 from Tolc-Software/release
v0.4.0:
2 parents c970680 + 9136649 commit 9c1315d

9 files changed

Lines changed: 48 additions & 10 deletions

File tree

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.17)
22

33
project(
44
tolc
5-
VERSION 0.3.0
5+
VERSION 0.4.0
66
LANGUAGES CXX)
77

88
configure_file(docs/ReleaseNotes/version.in
@@ -31,11 +31,11 @@ include(${modules}/Sanitizers.cmake)
3131
include(${modules}/StaticAnalyzers.cmake)
3232

3333
include(${modules}/GetFrontend.cmake)
34-
get_frontend(NAME Frontend.py VERSION v0.3.0)
34+
get_frontend(NAME Frontend.py VERSION v0.4.0)
3535
copy_frontend_docs(NAME Frontend.py SRC_DIR ${frontend.py_SOURCE_DIR} COPY_TO
3636
${CMAKE_CURRENT_LIST_DIR}/docs/packaging/docs/python)
3737

38-
get_frontend(NAME Frontend.wasm VERSION v0.4.1)
38+
get_frontend(NAME Frontend.wasm VERSION v0.4.2)
3939
copy_frontend_docs(
4040
NAME Frontend.wasm SRC_DIR ${frontend.wasm_SOURCE_DIR} COPY_TO
4141
${CMAKE_CURRENT_LIST_DIR}/docs/packaging/docs/webassembly)

cmake/packaging/tolc/tolcCreateTranslation.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ function(tolc_create_bindings)
6868
# NOTE: Variable injected from tolcConfig file
6969
get_pybind11(VERSION ${tolc_pybind11_version})
7070
# Create the python module
71-
pybind11_add_module(${tolc_target_name} ${ARG_OUTPUT}/${ARG_TARGET}.cpp
72-
SYSTEM)
71+
pybind11_add_module(${tolc_target_name}
72+
${ARG_OUTPUT}/${ARG_TARGET}_python.cpp)
7373
elseif(${ARG_LANGUAGE} MATCHES "wasm")
7474
# Assumes that the Emscripten toolchain file is used
7575
# Will result in a .js and a .wasm file
76-
add_executable(${tolc_target_name} ${ARG_OUTPUT}/${ARG_TARGET}.cpp)
76+
add_executable(${tolc_target_name} ${ARG_OUTPUT}/${ARG_TARGET}_wasm.cpp)
7777

7878
# Export Promise as 'loadMyLib' for module 'MyLib'
7979
# -s MODULARIZE=1 sets it as a promise based load

cmake/packaging/tolc/tolcTranslate.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ function(tolc_translate_file)
6666
tolc_translate_file_${ARG_MODULE_NAME} ALL
6767
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
6868
COMMAND ${command}
69-
BYPRODUCTS ${ARG_OUTPUT}/${ARG_MODULE_NAME}.cpp)
69+
BYPRODUCTS ${ARG_OUTPUT}/${ARG_MODULE_NAME}_${ARG_LANGUAGE}.cpp)
7070
endfunction()
7171

7272
function(tolc_translate_target)

docs/ReleaseNotes/v0.4.0.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# News #
2+
3+
## Output ##
4+
5+
* Renamed the bindings output file from `{library}.cpp` to `{library}_{language}.cpp`
6+
* This matches what the `target` is called in `CMake`
7+
* If you are using the `CMake` wrappers this is an internal change
8+
9+
* Vastly improved the readability of the `WebAssembly` bindings
10+
* Removed excessive whitespace when binding multiple namespaces
11+
* Fixed indentation when using public enums within classes
12+
13+
14+
## Minor ##
15+
16+
* Removed `SYSTEM` when creating a `CPython` library with `pybind11` since it no longer has any effect
17+
18+
If you want to include `pybind11` as a system header then add the following *after* calling `tolc_create_bindings`:
19+
20+
```cmake
21+
set_property(TARGET pybind11::pybind11 APPEND PROPERTY NO_SYSTEM_FROM_IMPORTED)
22+
```

docs/packaging/docs/webassembly/examples.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ withEnum.delete();
133133
```
134134

135135

136+
136137
## Enums ##
137138

138139

@@ -210,6 +211,7 @@ expect(company).toBe(m.MyNamespace.Carrier.Translator.Tolc);
210211
```
211212

212213

214+
213215
## Functions ##
214216

215217

@@ -252,6 +254,7 @@ expect(m.MyNamespace.Nested.increase(2)).toBe(3);
252254
```
253255

254256

257+
255258
## Global Variables ##
256259

257260

@@ -288,6 +291,7 @@ expect(m.MyNamespace.i).toBe(5);
288291
```
289292

290293

294+
291295
## Namespaces ##
292296

293297

@@ -330,6 +334,7 @@ expect(m.MyLib.We.Are.Going.Pretty.Deep.meaningOfLife()).toBe('42');
330334
```
331335

332336

337+
333338
## Smart Pointers ##
334339

335340

@@ -374,6 +379,7 @@ s.delete();
374379
```
375380

376381

382+
377383
## std::array ##
378384

379385

@@ -412,6 +418,7 @@ expect(data2).toStrictEqual([0, 1]);
412418
```
413419

414420

421+
415422
## std::map ##
416423

417424

@@ -446,6 +453,7 @@ expect(data.get(50)).toBe("Stuff");
446453
```
447454

448455

456+
449457
## std::pair ##
450458

451459

@@ -489,6 +497,7 @@ withFunction.delete();
489497
```
490498

491499

500+
492501
## std::tuple ##
493502

494503

@@ -547,6 +556,7 @@ withFunction.delete();
547556
```
548557

549558

559+
550560
## std::vector ##
551561

552562

@@ -580,3 +590,4 @@ expect(data.get(3)).toBe(3);
580590

581591
```
582592

593+

tests/packaging/systemTests/createTranslationTest/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,8 @@ tolc_create_bindings(
2525
OUTPUT
2626
${CMAKE_CURRENT_BINARY_DIR}/out
2727
NO_ANALYTICS)
28+
29+
set_property(
30+
TARGET pybind11::pybind11
31+
APPEND
32+
PROPERTY NO_SYSTEM_FROM_IMPORTED)

tests/packaging/systemTests/translateFileTest/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ tolc_translate_file(
2525

2626
# These will be made available to the consumer executable,
2727
# which will run the tests (see src/consumer.cpp)
28-
set(expected_out_file ${CMAKE_CURRENT_BINARY_DIR}/out/consumer.cpp)
28+
set(expected_out_file ${CMAKE_CURRENT_BINARY_DIR}/out/consumer_python.cpp)
2929
configure_file(src/check_variables.hpp.in
3030
${CMAKE_CURRENT_LIST_DIR}/src/check_variables.hpp @ONLY)
3131

tests/packaging/systemTests/translateLibraryTest/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ set(public_headers
2727
"\"${PROJECT_SOURCE_DIR}/include/consumer.hpp\",
2828
\"${PROJECT_SOURCE_DIR}/include/cStyleHeader.h\",
2929
\"${PROJECT_SOURCE_DIR}/include/SubDir/oneLevelDeep.hpp\"")
30-
set(expected_out_file ${CMAKE_CURRENT_BINARY_DIR}/out/consumer.cpp)
30+
set(expected_out_file ${CMAKE_CURRENT_BINARY_DIR}/out/consumer_python.cpp)
3131
set(expected_combined_header ${CMAKE_CURRENT_BINARY_DIR}/tolc/tolc_consumer.hpp)
3232
configure_file(src/check_variables.hpp.in
3333
${CMAKE_CURRENT_LIST_DIR}/src/check_variables.hpp @ONLY)

tests/packaging/systemTests/translateLibraryWithHeaders/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ target_include_directories(consumer PRIVATE src)
2525
# which will run the tests (see src/consumer.cpp)
2626
set(public_headers "\"${PROJECT_SOURCE_DIR}/include/consumer.hpp\",
2727
\"${PROJECT_SOURCE_DIR}/include/SubDir/oneLevelDeep.hpp\"")
28-
set(expected_out_file ${CMAKE_CURRENT_BINARY_DIR}/out/consumer.cpp)
28+
set(expected_out_file ${CMAKE_CURRENT_BINARY_DIR}/out/consumer_python.cpp)
2929
set(expected_combined_header ${CMAKE_CURRENT_BINARY_DIR}/tolc/tolc_consumer.hpp)
3030
configure_file(src/check_variables.hpp.in
3131
${CMAKE_CURRENT_LIST_DIR}/src/check_variables.hpp @ONLY)

0 commit comments

Comments
 (0)