Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix MSVC PDB installation #370

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of changing this CI job, add a new one in dev.yml that addresses this specific dev configuration


- 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"bin" might change based on other cmake variables, so it might be better to make that setting explicit at configure time to avoid fragility

..\..\RunTest.bat
./pcre2posix_test -v
..\..\build\RelWithDebInfo\pcre2posix_test -v
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this really needed?

20 changes: 12 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
$<TARGET_PDB_FILE_DIR:pcre2-8-shared>/pcre2-8.pdb
$<TARGET_PDB_FILE_DIR:pcre2-posix-shared>/pcre2-posix.pdb
${dll_pdb_files})
SET(dll_pdb_debug_files
$<TARGET_PDB_FILE_DIR:pcre2-8-shared>/pcre2-8d.pdb
$<TARGET_PDB_FILE_DIR:pcre2-posix-shared>/pcre2-posixd.pdb
${dll_pdb_debug_files})

IF(MINGW)
IF(NON_STANDARD_LIB_PREFIX)
Expand Down Expand Up @@ -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 $<TARGET_PDB_FILE_DIR:pcre2-16-shared>/pcre2-16.pdb ${dll_pdb_files})
SET(dll_pdb_debug_files $<TARGET_PDB_FILE_DIR:pcre2-16-shared>/pcre2-16d.pdb ${dll_pdb_debug_files})

IF(MINGW)
IF(NON_STANDARD_LIB_PREFIX)
Expand Down Expand Up @@ -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 $<TARGET_PDB_FILE_DIR:pcre2-32-shared>/pcre2-32.pdb ${dll_pdb_files})
SET(dll_pdb_debug_files $<TARGET_PDB_FILE_DIR:pcre2-32-shared>/pcre2-32d.pdb ${dll_pdb_debug_files})

IF(MINGW)
IF(NON_STANDARD_LIB_PREFIX)
Expand Down
Loading