diff --git a/.github/workflows/release-cpp.yml b/.github/workflows/release-cpp.yml index c843b99b..65161baa 100644 --- a/.github/workflows/release-cpp.yml +++ b/.github/workflows/release-cpp.yml @@ -28,7 +28,7 @@ jobs: - name: Install Go uses: actions/setup-go@v5 with: - go-version: "1.21.x" + go-version: "1.24.x" - name: Download dependencies run: | diff --git a/.github/workflows/release-csharp.yml b/.github/workflows/release-csharp.yml index e9490733..887605c7 100644 --- a/.github/workflows/release-csharp.yml +++ b/.github/workflows/release-csharp.yml @@ -28,7 +28,7 @@ jobs: - name: Install Go uses: actions/setup-go@v5 with: - go-version: "1.21.x" + go-version: "1.24.x" - name: Download dependencies run: | diff --git a/.github/workflows/release-go.yml b/.github/workflows/release-go.yml index 79ca9389..69378803 100644 --- a/.github/workflows/release-go.yml +++ b/.github/workflows/release-go.yml @@ -27,7 +27,7 @@ jobs: - name: Install Go uses: actions/setup-go@v5 with: - go-version: "1.21.x" + go-version: "1.24.x" - name: Download dependencies run: | diff --git a/.github/workflows/testing-cpp.yml b/.github/workflows/testing-cpp.yml index 9229d24f..92119728 100644 --- a/.github/workflows/testing-cpp.yml +++ b/.github/workflows/testing-cpp.yml @@ -16,19 +16,20 @@ jobs: test: strategy: matrix: + os: [ ubuntu-latest, windows-latest ] + go-version: [ 1.24.x ] + protobuf-version: [ "32.0", "3.19.3" ] include: - os: ubuntu-latest - go-version: 1.21.x init_script: bash init.sh run_loader: ./bin/loader - os: windows-latest - go-version: 1.21.x init_script: cmd /c init.bat run_loader: .\bin\loader.exe - name: test (${{ matrix.os }}) + name: test (${{ matrix.os }}, protobuf ${{ matrix.protobuf-version }}) runs-on: ${{ matrix.os }} - timeout-minutes: 10 + timeout-minutes: 20 steps: - name: Checkout Code @@ -56,11 +57,21 @@ jobs: - name: Init submodules and build protobuf run: ${{ matrix.init_script }} + env: + PROTOBUF_REF: v${{ matrix.protobuf-version }} - name: Install Protoc + if: "!startsWith(matrix.protobuf-version, '3.')" + uses: arduino/setup-protoc@v3 + with: + version: ${{ matrix.protobuf-version }} + repo-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Install Protoc (legacy) + if: startsWith(matrix.protobuf-version, '3.') uses: arduino/setup-protoc@v1 with: - version: "3.19.3" + version: ${{ matrix.protobuf-version }} repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Install Buf diff --git a/.github/workflows/testing-csharp.yml b/.github/workflows/testing-csharp.yml index 3937c779..6cd2c2bf 100644 --- a/.github/workflows/testing-csharp.yml +++ b/.github/workflows/testing-csharp.yml @@ -16,13 +16,11 @@ jobs: test: strategy: matrix: - include: - - os: ubuntu-latest - go-version: 1.21.x - - os: windows-latest - go-version: 1.21.x + os: [ ubuntu-latest, windows-latest ] + go-version: [ 1.24.x ] + protobuf-version: [ "32.0", "3.19.3" ] - name: test (${{ matrix.os }}) + name: test (${{ matrix.os }}, protobuf ${{ matrix.protobuf-version }}) runs-on: ${{ matrix.os }} timeout-minutes: 10 @@ -44,9 +42,17 @@ jobs: dotnet-version: "8.0.x" - name: Install Protoc + if: "!startsWith(matrix.protobuf-version, '3.')" + uses: arduino/setup-protoc@v3 + with: + version: ${{ matrix.protobuf-version }} + repo-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Install Protoc (legacy) + if: startsWith(matrix.protobuf-version, '3.') uses: arduino/setup-protoc@v1 with: - version: "3.19.3" + version: ${{ matrix.protobuf-version }} repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Install Buf diff --git a/.github/workflows/testing-go.yml b/.github/workflows/testing-go.yml index 9c54c255..3918c147 100644 --- a/.github/workflows/testing-go.yml +++ b/.github/workflows/testing-go.yml @@ -16,13 +16,11 @@ jobs: test: strategy: matrix: - include: - - os: ubuntu-latest - go-version: 1.21.x - - os: windows-latest - go-version: 1.21.x + os: [ ubuntu-latest, windows-latest ] + go-version: [ 1.24.x ] + protobuf-version: [ "32.0", "3.19.3" ] - name: test (${{ matrix.os }}) + name: test (${{ matrix.os }}, protobuf ${{ matrix.protobuf-version }}) runs-on: ${{ matrix.os }} timeout-minutes: 10 diff --git a/README.md b/README.md index 128934c9..97d037cf 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ The official config loader for [Tableau](https://github.com/tableauio/tableau). ### Dev at Linux - Change dir: `cd test/cpp-tableau-loader` -- Generate protoconf: `PATH=../../third_party/_submodules/protobuf/cmake/build:$PATH buf generate ..` +- Generate protoconf: `PATH=../../third_party/_submodules/protobuf/.build/_install/bin:$PATH buf generate ..` - CMake: - C++17: `cmake -S . -B build` - C++20: `cmake -S . -B build -DCMAKE_CXX_STANDARD=20` @@ -53,7 +53,7 @@ The official config loader for [Tableau](https://github.com/tableauio/tableau). - Initialize MSVC environment (from loader root): `.\prepare.bat` - Change dir: `cd test\cpp-tableau-loader`, or change directory with Drive, e.g.: `cd /D D:\GitHub\loader\test\cpp-tableau-loader` -- Generate protoconf: `cmd /C "set PATH=..\..\third_party\_submodules\protobuf\cmake\build;%PATH% && buf generate .."` +- Generate protoconf: `cmd /C "set PATH=..\..\third_party\_submodules\protobuf\.build\_install\bin;%PATH% && buf generate .."` - CMake: - C++17: `cmake -S . -B build -G "Ninja"` - C++20: `cmake -S . -B build -G "Ninja" -DCMAKE_CXX_STANDARD=20` @@ -87,7 +87,7 @@ The official config loader for [Tableau](https://github.com/tableauio/tableau). - Install: **dotnet-sdk-8.0** - Change dir: `cd test/csharp-tableau-loader` -- Generate protoconf: `PATH=../third_party/_submodules/protobuf/cmake/build:$PATH buf generate .. ` +- Generate protoconf: `PATH=../third_party/_submodules/protobuf/.build/_install/bin:$PATH buf generate ..` - Test: `dotnet run` ## TypeScript diff --git a/cmd/protoc-gen-cpp-tableau-loader/main.go b/cmd/protoc-gen-cpp-tableau-loader/main.go index bf90b56f..163a25cc 100644 --- a/cmd/protoc-gen-cpp-tableau-loader/main.go +++ b/cmd/protoc-gen-cpp-tableau-loader/main.go @@ -6,6 +6,7 @@ import ( "github.com/tableauio/loader/internal/options" "google.golang.org/protobuf/compiler/protogen" + "google.golang.org/protobuf/types/descriptorpb" "google.golang.org/protobuf/types/pluginpb" ) @@ -50,7 +51,9 @@ func main() { protogen.Options{ ParamFunc: flags.Set, }.Run(func(gen *protogen.Plugin) error { - gen.SupportedFeatures = uint64(pluginpb.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL) + gen.SupportedFeatures = uint64(pluginpb.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL | pluginpb.CodeGeneratorResponse_FEATURE_SUPPORTS_EDITIONS) + gen.SupportedEditionsMinimum = descriptorpb.Edition_EDITION_PROTO2 + gen.SupportedEditionsMaximum = descriptorpb.Edition_EDITION_2024 for _, f := range gen.Files { if !options.NeedGenFile(f) { continue diff --git a/cmd/protoc-gen-csharp-tableau-loader/main.go b/cmd/protoc-gen-csharp-tableau-loader/main.go index bad35e59..9ace60e2 100644 --- a/cmd/protoc-gen-csharp-tableau-loader/main.go +++ b/cmd/protoc-gen-csharp-tableau-loader/main.go @@ -6,6 +6,7 @@ import ( "github.com/tableauio/loader/internal/options" "google.golang.org/protobuf/compiler/protogen" + "google.golang.org/protobuf/types/descriptorpb" "google.golang.org/protobuf/types/pluginpb" ) @@ -24,7 +25,9 @@ func main() { protogen.Options{ ParamFunc: flags.Set, }.Run(func(gen *protogen.Plugin) error { - gen.SupportedFeatures = uint64(pluginpb.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL) + gen.SupportedFeatures = uint64(pluginpb.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL | pluginpb.CodeGeneratorResponse_FEATURE_SUPPORTS_EDITIONS) + gen.SupportedEditionsMinimum = descriptorpb.Edition_EDITION_PROTO2 + gen.SupportedEditionsMaximum = descriptorpb.Edition_EDITION_2024 for _, f := range gen.Files { if !options.NeedGenFile(f) { continue diff --git a/cmd/protoc-gen-go-tableau-loader/main.go b/cmd/protoc-gen-go-tableau-loader/main.go index 8ae2859e..d37413f9 100644 --- a/cmd/protoc-gen-go-tableau-loader/main.go +++ b/cmd/protoc-gen-go-tableau-loader/main.go @@ -6,6 +6,7 @@ import ( "github.com/tableauio/loader/internal/options" "google.golang.org/protobuf/compiler/protogen" + "google.golang.org/protobuf/types/descriptorpb" "google.golang.org/protobuf/types/pluginpb" ) @@ -27,7 +28,9 @@ func main() { protogen.Options{ ParamFunc: flags.Set, }.Run(func(gen *protogen.Plugin) error { - gen.SupportedFeatures = uint64(pluginpb.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL) + gen.SupportedFeatures = uint64(pluginpb.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL | pluginpb.CodeGeneratorResponse_FEATURE_SUPPORTS_EDITIONS) + gen.SupportedEditionsMinimum = descriptorpb.Edition_EDITION_PROTO2 + gen.SupportedEditionsMaximum = descriptorpb.Edition_EDITION_2024 for _, f := range gen.Files { if !options.NeedGenFile(f) { continue diff --git a/go.mod b/go.mod index cb246e6f..10bf1e80 100644 --- a/go.mod +++ b/go.mod @@ -1,13 +1,13 @@ module github.com/tableauio/loader -go 1.21 +go 1.24.0 require ( github.com/aymanbagabas/go-udiff v0.2.0 github.com/iancoleman/strcase v0.3.0 github.com/stretchr/testify v1.10.0 github.com/tableauio/tableau v0.15.1 - google.golang.org/protobuf v1.34.2 + google.golang.org/protobuf v1.36.11 ) require ( diff --git a/go.sum b/go.sum index e5396710..08feefe5 100644 --- a/go.sum +++ b/go.sum @@ -11,8 +11,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= -github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= -github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= @@ -66,8 +66,8 @@ golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= -google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= -google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= +google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= +google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= diff --git a/init.bat b/init.bat index a83d505c..c2eb5de7 100644 --- a/init.bat +++ b/init.bat @@ -14,23 +14,61 @@ cd /d "%repoRoot%" git submodule update --init --recursive REM Build and install the C++ Protocol Buffer runtime and the Protocol Buffer compiler (protoc) -REM Refer: https://github.com/protocolbuffers/protobuf/blob/3.19.x/cmake/README.md#cmake-configuration -cd third_party\_submodules\protobuf\cmake -REM use Debug version -REM - protobuf_MSVC_STATIC_RUNTIME defaults to ON, which uses static CRT (/MTd for Debug). -REM Our project's CMakeLists.txt also sets static CRT to match. -REM - protobuf_WITH_ZLIB=OFF: disable ZLIB dependency to avoid ZLIB::ZLIB link requirement -REM in protobuf's exported CMake targets, which simplifies cross-platform builds. -REM - protobuf_BUILD_SHARED_LIBS=OFF: build static libraries explicitly. -cmake -S . -B build -G Ninja ^ - -DCMAKE_BUILD_TYPE=Debug ^ - -DCMAKE_CXX_STANDARD=17 ^ - -DCMAKE_POLICY_VERSION_MINIMUM=3.5 ^ - -Dprotobuf_BUILD_TESTS=OFF ^ - -Dprotobuf_WITH_ZLIB=OFF ^ - -Dprotobuf_BUILD_SHARED_LIBS=OFF +cd third_party\_submodules\protobuf + +REM If PROTOBUF_REF is set, switch submodule to the specified ref +if not "%PROTOBUF_REF%"=="" ( + echo Switching protobuf submodule to %PROTOBUF_REF%... + git fetch --tags + git checkout %PROTOBUF_REF% + git submodule update --init --recursive +) + +REM Detect protobuf major version to determine cmake source directory and arguments. +for /f "tokens=*" %%v in ('git describe --tags --abbrev^=0 2^>nul') do set PROTOBUF_VERSION=%%v +if not defined PROTOBUF_VERSION set PROTOBUF_VERSION=unknown +echo Detected protobuf version: %PROTOBUF_VERSION% + +REM Extract major version number from tag (e.g., v3.19.3 -> 3, v32.0 -> 32) +set "VER_STR=%PROTOBUF_VERSION:~1%" +for /f "tokens=1 delims=." %%a in ("%VER_STR%") do set MAJOR_VERSION=%%a + +if %MAJOR_VERSION% LEQ 3 ( + REM Legacy protobuf (v3.x): CMakeLists.txt is in cmake/ subdirectory + echo Using legacy cmake\ subdirectory for protobuf %PROTOBUF_VERSION% + cmake -S cmake -B .build -G Ninja ^ + -DCMAKE_BUILD_TYPE=Debug ^ + -DCMAKE_CXX_STANDARD=17 ^ + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 ^ + -Dprotobuf_BUILD_TESTS=OFF ^ + -Dprotobuf_WITH_ZLIB=OFF ^ + -Dprotobuf_BUILD_SHARED_LIBS=OFF +) else ( + REM Modern protobuf (v4+/v21+/v32+): CMakeLists.txt is in root directory + REM Refer: https://github.com/protocolbuffers/protobuf/blob/v32.0/cmake/README.md#cmake-configuration + echo Using root CMakeLists.txt for protobuf %PROTOBUF_VERSION% + REM - protobuf_MSVC_STATIC_RUNTIME defaults to ON, which uses static CRT (/MTd for Debug). + REM Our project's CMakeLists.txt also sets static CRT to match. + REM - protobuf_WITH_ZLIB=OFF: disable ZLIB dependency to avoid ZLIB::ZLIB link requirement + REM in protobuf's exported CMake targets, which simplifies cross-platform builds. + REM - protobuf_BUILD_SHARED_LIBS=OFF: build static libraries explicitly. + cmake -S . -B .build -G Ninja ^ + -DCMAKE_BUILD_TYPE=Debug ^ + -DCMAKE_CXX_STANDARD=17 ^ + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 ^ + -Dprotobuf_BUILD_TESTS=OFF ^ + -Dprotobuf_WITH_ZLIB=OFF ^ + -Dprotobuf_BUILD_SHARED_LIBS=OFF ^ + -Dutf8_range_ENABLE_INSTALL=ON +) REM Compile the code -cmake --build build --parallel +cmake --build .build --parallel + +REM Install into .build/_install so that protobuf-config.cmake (along with +REM absl and utf8_range configs) is generated for find_package(Protobuf CONFIG) +REM used by downstream CMakeLists.txt. +REM NOTE: .build/ is already in protobuf's .gitignore, so _install stays clean. +cmake --install .build --prefix .build\_install endlocal diff --git a/init.sh b/init.sh index 84b7a1f9..d1053899 100755 --- a/init.sh +++ b/init.sh @@ -12,20 +12,55 @@ git submodule update --init --recursive # sudo apt-get install autoconf automake libtool curl make g++ unzip # Build and install the C++ Protocol Buffer runtime and the Protocol Buffer compiler (protoc) -# Refer: https://github.com/protocolbuffers/protobuf/blob/3.19.x/cmake/README.md#cmake-configuration -cd third_party/_submodules/protobuf/cmake -# use Debug version -# - protobuf_MSVC_STATIC_RUNTIME defaults to ON, which uses static CRT (/MTd for Debug). -# Our project's CMakeLists.txt also sets static CRT to match. -# - protobuf_WITH_ZLIB=OFF: disable ZLIB dependency to avoid ZLIB::ZLIB link requirement -# in protobuf's exported CMake targets, which simplifies cross-platform builds. -# - protobuf_BUILD_SHARED_LIBS=OFF: build static libraries explicitly. -cmake -S . -B build -G Ninja \ - -DCMAKE_BUILD_TYPE=Debug \ - -DCMAKE_CXX_STANDARD=17 \ - -Dprotobuf_BUILD_TESTS=OFF \ - -Dprotobuf_WITH_ZLIB=OFF \ - -Dprotobuf_BUILD_SHARED_LIBS=OFF +cd third_party/_submodules/protobuf + +# If PROTOBUF_REF is set, switch submodule to the specified ref +if [ -n "${PROTOBUF_REF:-}" ]; then + echo "Switching protobuf submodule to ${PROTOBUF_REF}..." + git fetch --tags + git checkout "${PROTOBUF_REF}" + git submodule update --init --recursive +fi + +# Detect protobuf major version to determine cmake source directory and arguments. +# - protobuf v3.x uses cmake/ subdirectory for CMake builds with minimal options. +# - protobuf v4+ (v21+) and latest (v32+) use the root directory with additional options. +PROTOBUF_VERSION=$(git describe --tags --abbrev=0 2>/dev/null || echo "unknown") +echo "Detected protobuf version: ${PROTOBUF_VERSION}" + +# Extract major version number from tag (e.g., v3.19.3 -> 3, v32.0 -> 32) +MAJOR_VERSION=$(echo "${PROTOBUF_VERSION}" | sed 's/^v//' | cut -d. -f1) + +if [ "${MAJOR_VERSION}" -le 3 ] 2>/dev/null; then + # Legacy protobuf (v3.x): CMakeLists.txt is in cmake/ subdirectory + echo "Using legacy cmake/ subdirectory for protobuf ${PROTOBUF_VERSION}" + cmake -S cmake -B .build -G Ninja \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_CXX_STANDARD=17 \ + -Dprotobuf_BUILD_TESTS=OFF \ + -Dprotobuf_WITH_ZLIB=OFF \ + -Dprotobuf_BUILD_SHARED_LIBS=OFF +else + # Modern protobuf (v4+/v21+/v32+): CMakeLists.txt is in root directory + # Refer: https://github.com/protocolbuffers/protobuf/blob/v32.0/cmake/README.md#cmake-configuration + echo "Using root CMakeLists.txt for protobuf ${PROTOBUF_VERSION}" + # - protobuf_WITH_ZLIB=OFF: disable ZLIB dependency to avoid ZLIB::ZLIB link requirement + # in protobuf's exported CMake targets, which simplifies cross-platform builds. + # - protobuf_BUILD_SHARED_LIBS=OFF: build static libraries explicitly. + cmake -S . -B .build -G Ninja \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_CXX_STANDARD=17 \ + -Dprotobuf_BUILD_TESTS=OFF \ + -Dprotobuf_WITH_ZLIB=OFF \ + -Dprotobuf_BUILD_SHARED_LIBS=OFF \ + -Dutf8_range_ENABLE_INSTALL=ON +fi # Compile the code -cmake --build build --parallel +cmake --build .build --parallel + +# Install into .build/_install so that protobuf-config.cmake (along with +# absl and utf8_range configs) is generated for find_package(Protobuf CONFIG) +# used by downstream CMakeLists.txt. +# NOTE: .build/ is already in protobuf's .gitignore, so _install stays clean. +cmake --install .build --prefix .build/_install diff --git a/test/cpp-tableau-loader/CMakeLists.txt b/test/cpp-tableau-loader/CMakeLists.txt index 11a28231..00bd3a3d 100644 --- a/test/cpp-tableau-loader/CMakeLists.txt +++ b/test/cpp-tableau-loader/CMakeLists.txt @@ -31,11 +31,11 @@ endif() # - Linux: build/lib64/cmake/protobuf/ (via CMAKE_INSTALL_LIBDIR) # - Windows: build/cmake/ (MSVC uses "cmake" directly) # Setting CMAKE_PREFIX_PATH to the build dir allows CMake to search both layouts. -set(LOCAL_PROTOBUF_BUILD_DIR "${PROJECT_SOURCE_DIR}/../../third_party/_submodules/protobuf/cmake/build") +set(LOCAL_PROTOBUF_INSTALL_DIR "${PROJECT_SOURCE_DIR}/../../third_party/_submodules/protobuf/.build/_install") set(LOCAL_PROTOBUF_SRC_DIR "${PROJECT_SOURCE_DIR}/../../third_party/_submodules/protobuf/src") -if(EXISTS "${LOCAL_PROTOBUF_BUILD_DIR}" AND EXISTS "${LOCAL_PROTOBUF_SRC_DIR}") +if(EXISTS "${LOCAL_PROTOBUF_INSTALL_DIR}" AND EXISTS "${LOCAL_PROTOBUF_SRC_DIR}") message(STATUS "Found local protobuf submodule, using it preferentially.") - list(PREPEND CMAKE_PREFIX_PATH "${LOCAL_PROTOBUF_BUILD_DIR}") + list(PREPEND CMAKE_PREFIX_PATH "${LOCAL_PROTOBUF_INSTALL_DIR}") endif() # Use CONFIG mode explicitly to pick up protobuf's own protobuf-config.cmake diff --git a/test/csharp-tableau-loader/Loader.csproj b/test/csharp-tableau-loader/Loader.csproj index 68dbf5e1..fc0c2e28 100644 --- a/test/csharp-tableau-loader/Loader.csproj +++ b/test/csharp-tableau-loader/Loader.csproj @@ -11,7 +11,7 @@ - +