Rename cxx directory to cpp

Also update the crate name and references to it. This helps distinguish the C++ wrapper that's built using CXX from CXX itself.
This commit is contained in:
Oliver Hamlet
2025-04-29 17:42:46 +01:00
parent 2b1b67daba
commit 83d9420422
90 changed files with 34 additions and 36 deletions
+5 -9
View File
@@ -124,10 +124,6 @@ jobs:
working-directory: nodejs
run: npm test
- name: Build the CXX wrapper layer
working-directory: cxx
run: cargo build --release --target ${{ matrix.target.triple }}
- name: Get descriptive libloot version
id: get-libloot-version
shell: bash
@@ -138,7 +134,7 @@ jobs:
echo "version=$LIBLOOT_SAFE_DESC_REF" >> $GITHUB_OUTPUT
- name: Build the C++ wrapper (Linux)
working-directory: cxx
working-directory: cpp
run: |
cmake \
-DCMAKE_BUILD_TYPE=${{ env.CMAKE_CONFIG }} \
@@ -149,7 +145,7 @@ jobs:
if: runner.os == 'Linux'
- name: Build the C++ wrapper (Windows)
working-directory: cxx
working-directory: cpp
run: |
cmake -G "Visual Studio 16 2019" `
-A ${{ matrix.target.platform }} `
@@ -160,11 +156,11 @@ jobs:
if: runner.os == 'Windows'
- name: Run the C++ wrapper tests
working-directory: cxx
working-directory: cpp
run: ctest --test-dir build --build-config ${{ env.CMAKE_CONFIG }} --output-on-failure --parallel
- name: Package the C++ wrapper
working-directory: cxx/build
working-directory: cpp/build
run: cpack -C ${{ env.CMAKE_CONFIG }}
- name: Get archive name
@@ -193,5 +189,5 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: ${{ steps.archive-name.outputs.filename }}
path: cxx/build/package/${{ steps.archive-name.outputs.filename }}
path: cpp/build/package/${{ steps.archive-name.outputs.filename }}
if: github.event_name == 'push'
Generated
+1 -1
View File
@@ -565,7 +565,7 @@ dependencies = [
]
[[package]]
name = "libloot-cxx"
name = "libloot-cpp"
version = "0.26.0"
dependencies = [
"cxx",
+1 -1
View File
@@ -27,7 +27,7 @@ parameterized-test = { path = "./parameterized-test" }
tempfile = "3.17.1"
[workspace]
members = ["cxx", "ffi-errors", "nodejs", "parameterized-test", "python"]
members = ["cpp", "ffi-errors", "nodejs", "parameterized-test", "python"]
[workspace.dependencies]
esplugin = "6.1.2"
+1 -1
View File
@@ -2,7 +2,7 @@
This is an **experimental** reimplementation of [libloot](https://github.com/loot/libloot) using Rust instead of C++, that should match libloot v0.26.0.
See the `cxx` and `python` subdirectories for C++ and Python wrappers respectively.
See the `cpp` and `python` subdirectories for C++ and Python wrappers respectively.
Expect:
View File
+15 -13
View File
@@ -25,9 +25,9 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
##############################
if(MSVC)
set(LIBLOOT_CXX_FILENAME "libloot_cxx.lib")
set(LIBLOOT_CPP_FILENAME "libloot_cpp.lib")
else()
set(LIBLOOT_CXX_FILENAME "liblibloot_cxx.a")
set(LIBLOOT_CPP_FILENAME "liblibloot_cpp.a")
endif()
if(DEFINED RUST_TARGET)
@@ -36,25 +36,27 @@ else()
set(TARGET_PATH "${CMAKE_SOURCE_DIR}/../target")
endif()
add_custom_target(libloot-cxx-build
add_custom_target(libloot-cpp-build
COMMAND cargo build
$<$<NOT:$<CONFIG:Debug>>:--release>
$<$<AND:$<CONFIG:Debug>,$<PLATFORM_ID:Windows>>:--config>
$<$<AND:$<CONFIG:Debug>,$<PLATFORM_ID:Windows>>:${CMAKE_SOURCE_DIR}/.cargo/msvc-debug-config.toml>
$<$<BOOL:${RUST_TARGET}>:--target>
$<$<BOOL:${RUST_TARGET}>:${RUST_TARGET}>
BYPRODUCTS
"${TARGET_PATH}/$<IF:$<CONFIG:Debug>,debug,release>/${LIBLOOT_CXX_FILENAME}"
"${TARGET_PATH}/cxxbridge/libloot-cxx/src/lib.rs.cc"
"${TARGET_PATH}/cxxbridge/libloot-cxx/src/lib.rs.h"
"${TARGET_PATH}/$<IF:$<CONFIG:Debug>,debug,release>/${LIBLOOT_CPP_FILENAME}"
"${TARGET_PATH}/cxxbridge/libloot-cpp/src/lib.rs.cc"
"${TARGET_PATH}/cxxbridge/libloot-cpp/src/lib.rs.h"
"${TARGET_PATH}/cxxbridge/rust/cxx.h"
)
add_library(libloot-cxx INTERFACE)
add_dependencies(libloot-cxx libloot-cxx-build)
add_library(libloot-cpp INTERFACE)
add_dependencies(libloot-cpp libloot-cpp-build)
target_link_libraries(libloot-cxx INTERFACE
optimized "${TARGET_PATH}/release/${LIBLOOT_CXX_FILENAME}"
debug "${TARGET_PATH}/debug/${LIBLOOT_CXX_FILENAME}")
target_include_directories(libloot-cxx INTERFACE "${TARGET_PATH}/cxxbridge")
target_link_libraries(libloot-cpp INTERFACE
optimized "${TARGET_PATH}/release/${LIBLOOT_CPP_FILENAME}"
debug "${TARGET_PATH}/debug/${LIBLOOT_CPP_FILENAME}")
target_include_directories(libloot-cpp INTERFACE "${TARGET_PATH}/cxxbridge")
##############################
@@ -142,7 +144,7 @@ set(LIBLOOT_ALL_SOURCES
# Build API.
add_library(loot ${LIBLOOT_ALL_SOURCES})
target_link_libraries(loot PRIVATE libloot-cxx)
target_link_libraries(loot PRIVATE libloot-cpp)
##############################
# Set Target-Specific Flags
+1 -1
View File
@@ -1,5 +1,5 @@
[package]
name = "libloot-cxx"
name = "libloot-cpp"
version = "0.26.0"
edition = "2024"
license = "GPL-3.0"
View File
+1 -1
View File
@@ -3,7 +3,7 @@ fn main() {
.std("c++17")
.flag_if_supported("/Zc:__cplusplus")
.flag_if_supported("/permissive-")
.compile("libloot-cxx");
.compile("libloot-cpp");
// From <https://github.com/dtolnay/cxx/issues/880#issuecomment-2521375384>
if std::env::var("TARGET").is_ok_and(|s| s.contains("windows-msvc")) {
@@ -97,7 +97,7 @@ set(LIBLOOT_INTERFACE_TESTS_ALL_SOURCES
# Build tests.
add_executable(libloot_internals_tests ${LIBLOOT_INTERNALS_TESTS_ALL_SOURCES})
target_link_libraries(libloot_internals_tests PRIVATE
libloot-cxx
libloot-cpp
GTest::gtest_main)
# Build API tests.

Some files were not shown because too many files have changed in this diff Show More