From 43414859213bf1d0e91b71961c7be9d2b4fd5c5b Mon Sep 17 00:00:00 2001 From: Bumsu Hyeon Date: Mon, 15 Jan 2024 10:54:14 +0900 Subject: [PATCH] fix MSVC PDB installation --- .github/workflows/build.yml | 11 +++++++---- CMakeLists.txt | 20 ++++++++++++-------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2296cfe87..8b1d759bd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -104,13 +104,16 @@ jobs: uses: actions/checkout@v3 - name: Configure - run: cmake -DPCRE2_SUPPORT_JIT=ON -DPCRE2_BUILD_PCRE2_16=ON -DPCRE2_BUILD_PCRE2_32=ON -DCMAKE_IGNORE_PREFIX_PATH=C:/Strawberry/c -B build -A Win32 + run: cmake -G "Visual Studio 17 2022" -DBUILD_SHARED_LIBS=ON -DINSTALL_MSVC_PDB=ON -DPCRE2_SUPPORT_JIT=ON -DPCRE2_BUILD_PCRE2_16=ON -DPCRE2_BUILD_PCRE2_32=ON -DCMAKE_IGNORE_PREFIX_PATH=C:/Strawberry/c -B build -A Win32 - name: Build - run: cmake --build build + run: cmake --build build --config=RelWithDebInfo + + - name: Install + run: cmake --install build --config=RelWithDebInfo --prefix=install - name: Test run: | - cd build\Debug + cd install\bin ..\..\RunTest.bat - ./pcre2posix_test -v + ..\..\build\RelWithDebInfo\pcre2posix_test -v diff --git a/CMakeLists.txt b/CMakeLists.txt index 599d5bfae..aef322743 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -648,8 +648,6 @@ IF(MINGW AND BUILD_SHARED_LIBS) ENDIF(MINGW AND BUILD_SHARED_LIBS) IF(MSVC AND BUILD_SHARED_LIBS) - SET(dll_pdb_files ${PROJECT_BINARY_DIR}/pcre2-posix.pdb ${dll_pdb_files}) - SET(dll_pdb_debug_files ${PROJECT_BINARY_DIR}/pcre2-posixd.pdb ${dll_pdb_debug_files}) IF (EXISTS ${PROJECT_SOURCE_DIR}/pcre2.rc) SET(PCRE2_SOURCES ${PCRE2_SOURCES} pcre2.rc) ENDIF(EXISTS ${PROJECT_SOURCE_DIR}/pcre2.rc) @@ -751,8 +749,14 @@ IF(PCRE2_BUILD_PCRE2_8) TARGET_COMPILE_DEFINITIONS(pcre2-posix-shared PUBLIC ${PCRE2POSIX_CFLAG}) TARGET_LINK_LIBRARIES(pcre2-posix-shared pcre2-8-shared) SET(targets ${targets} pcre2-posix-shared) - SET(dll_pdb_files ${PROJECT_BINARY_DIR}/pcre2-8.pdb ${dll_pdb_files}) - SET(dll_pdb_debug_files ${PROJECT_BINARY_DIR}/pcre2-8d.pdb ${dll_pdb_debug_files}) + SET(dll_pdb_files + $/pcre2-8.pdb + $/pcre2-posix.pdb + ${dll_pdb_files}) + SET(dll_pdb_debug_files + $/pcre2-8d.pdb + $/pcre2-posixd.pdb + ${dll_pdb_debug_files}) IF(MINGW) IF(NON_STANDARD_LIB_PREFIX) @@ -815,8 +819,8 @@ IF(PCRE2_BUILD_PCRE2_16) TARGET_LINK_LIBRARIES(pcre2-16-shared Threads::Threads) ENDIF(REQUIRE_PTHREAD) set(targets ${targets} pcre2-16-shared) - SET(dll_pdb_files ${PROJECT_BINARY_DIR}/pcre2-16.pdb ${dll_pdb_files}) - SET(dll_pdb_debug_files ${PROJECT_BINARY_DIR}/pcre2-16d.pdb ${dll_pdb_debug_files}) + SET(dll_pdb_files $/pcre2-16.pdb ${dll_pdb_files}) + SET(dll_pdb_debug_files $/pcre2-16d.pdb ${dll_pdb_debug_files}) IF(MINGW) IF(NON_STANDARD_LIB_PREFIX) @@ -877,8 +881,8 @@ IF(PCRE2_BUILD_PCRE2_32) TARGET_LINK_LIBRARIES(pcre2-32-shared Threads::Threads) ENDIF(REQUIRE_PTHREAD) set(targets ${targets} pcre2-32-shared) - SET(dll_pdb_files ${PROJECT_BINARY_DIR}/pcre2-32.pdb ${dll_pdb_files}) - SET(dll_pdb_debug_files ${PROJECT_BINARY_DIR}/pcre2-32d.pdb ${dll_pdb_debug_files}) + SET(dll_pdb_files $/pcre2-32.pdb ${dll_pdb_files}) + SET(dll_pdb_debug_files $/pcre2-32d.pdb ${dll_pdb_debug_files}) IF(MINGW) IF(NON_STANDARD_LIB_PREFIX)