Skip to content

Commit

Permalink
Added publishing debug symbols on windows builds GrandOrgue#853 (Gran…
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg68 authored May 15, 2022
1 parent 2658a37 commit 0908243
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
- Added publishing debug symbols on windows builds https://github.com/GrandOrgue/grandorgue/issues/853
# 3.6.6 (2022-04-29)
- Fixed help issues https://github.com/GrandOrgue/grandorgue/issues/1066
- Fixed saving organ settings on closing an organ or on finishing GrandOrgue https://github.com/GrandOrgue/grandorgue/issues/1069
Expand Down
2 changes: 2 additions & 0 deletions build-scripts/for-win64/build-on-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ GO_WIN_PRMS="-DCMAKE_SYSTEM_NAME=Windows \
-DCMAKE_SYSTEM_PROCESSOR=x86_64 \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DRTAUDIO_USE_ASIO=ON -DASIO_SDK_DIR=/usr/local/asio-sdk \
-DVC_PATH=/usr/local/share/wine/msvc/VC/Tools/MSVC/14.29.30133/bin/Hostx86/x86 \
-DCV2PDB_EXE=/usr/local/share/wine/cv2pdb/cv2pdb.exe \
-DIMPORT_EXECUTABLES=../build-tools/ImportExecutables.cmake"
GO_PRMS="-DGO_USE_JACK=ON $CMAKE_VERSION_PRMS"

Expand Down
37 changes: 33 additions & 4 deletions build-scripts/for-win64/prepare-ubuntu-20.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
#!/bin/bash

set -e
sudo apt update
sudo DEBIAN_FRONTEND=noninteractive apt install -y \
sudo dpkg --add-architecture i386
sudo apt-get update

# remove an odd version of ibpcre2-8-0 that prevents installing wine32
# determine the required version of ibpcre2-8-0
LIBPCRE_VERSION=`apt-cache policy libpcre2-8-0:i386 | awk '/Candidate:/ { print $2; }'`
sudo DEBIAN_FRONTEND=noninteractive apt-get --allow-downgrades -y install libpcre2-8-0=$LIBPCRE_VERSION

sudo DEBIAN_FRONTEND=noninteractive apt-get install -y \
wget unzip cmake g++ pkg-config g++-mingw-w64-x86-64 nsis \
docbook-xsl xsltproc gettext po4a imagemagick zip \
libz-mingw-w64-dev
docbook-xsl xsltproc gettext po4a imagemagick zip libz-mingw-w64-dev \
wine32 winbind

mkdir -p deb
pushd deb
Expand Down Expand Up @@ -35,3 +42,25 @@ if [ ! -d /usr/local/asio-sdk ]; then
SDK_DIR=`ls -1d /usr/local/asiosdk* | tail -1`
sudo ln -sf `basename $SDK_DIR` /usr/local/asio-sdk
fi

# download VC for wine
if [ ! -d /usr/local/share/wine/msvc ]; then
DL_DIR=`mktemp -d -t vc.XXX`
wget -O $DL_DIR/VC2019.zip https://github.com/GrandOrgue/DockerMsvcCpp/releases/download/0.1/VC2019.zip
sudo mkdir -p /usr/local/share/wine/msvc.tmp
sudo rm -rf /usr/local/share/wine/msvc.tmp/*
sudo unzip -d /usr/local/share/wine/msvc.tmp $DL_DIR/VC2019.zip
rm -rf $DL_DIR
sudo mv /usr/local/share/wine/msvc.tmp /usr/local/share/wine/msvc
fi

# download cv2pdb
if [ ! -d /usr/local/share/wine/cv2pdb ]; then
DL_DIR=`mktemp -d -t cv2pdb.XXX`
wget -O $DL_DIR/cv2pdb-0.51.zip https://github.com/rainers/cv2pdb/releases/download/v0.51/cv2pdb-0.51.zip
sudo mkdir -p /usr/local/share/wine/cv2pdb.tmp
sudo rm -rf /usr/local/share/wine/cv2pdb.tmp/*
sudo unzip -d /usr/local/share/wine/cv2pdb.tmp $DL_DIR/cv2pdb-0.51.zip
rm -rf $DL_DIR
sudo mv /usr/local/share/wine/cv2pdb.tmp /usr/local/share/wine/cv2pdb
fi
17 changes: 16 additions & 1 deletion cmake/BuildExecutable.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,21 @@ function(BUILD_EXECUTABLE TARGET)
else()
set_target_properties(${TARGET} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${BINDIR}")
endif()

install(TARGETS ${TARGET} RUNTIME DESTINATION "${BININSTDIR}")

if(CV2PDB_EXE)
add_custom_command(
OUTPUT "${BINDIR}/${TARGET}.pdb"
DEPENDS ${TARGET}
COMMAND
${CMAKE_COMMAND}
-E env "WINEPATH=Z:${VC_PATH}"
wine "${CV2PDB_EXE}"
"$<TARGET_FILE:${TARGET}>"
"${CMAKE_CURRENT_BINARY_DIR}/$<TARGET_FILE_PREFIX:${TARGET}>$<TARGET_FILE_BASE_NAME:${TARGET}>-tmp$<TARGET_FILE_SUFFIX:${TARGET}>"
"${BINDIR}/${TARGET}.pdb"
)
add_custom_target(${TARGET}.pdb ALL DEPENDS "${BINDIR}/${TARGET}.pdb")
install(FILES "${BINDIR}/${TARGET}.pdb" DESTINATION "${BININSTDIR}")
endif()
endfunction()
18 changes: 17 additions & 1 deletion cmake/BuildLibrary.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,28 @@ function(BUILD_LIBRARY TARGET)

install(
TARGETS ${TARGET}
RUNTIME DESTINATION ${LIBINSTDIR} LIBRARY DESTINATION ${LIBINSTDIR}
RUNTIME DESTINATION ${LIBINSTDIR} LIBRARY DESTINATION ${LIBINSTDIR}
NAMELINK_SKIP
# these permissions required for building rmp on debian/ubuntu
# otherwise Autoprov doesn't work
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
GROUP_EXECUTE GROUP_READ
WORLD_EXECUTE WORLD_READ
)

if(CV2PDB_EXE)
add_custom_command(
OUTPUT "${LIBDIR}/lib${TARGET}.pdb"
DEPENDS ${TARGET}
COMMAND
${CMAKE_COMMAND}
-E env "WINEPATH=Z:${VC_PATH}"
wine "${CV2PDB_EXE}"
"$<TARGET_FILE:${TARGET}>"
"${CMAKE_CURRENT_BINARY_DIR}/$<TARGET_FILE_PREFIX:${TARGET}>$<TARGET_FILE_BASE_NAME:${TARGET}>-tmp$<TARGET_FILE_SUFFIX:${TARGET}>"
"${LIBDIR}/lib${TARGET}.pdb"
)
add_custom_target(lib${TARGET}.pdb ALL DEPENDS "${LIBDIR}/lib${TARGET}.pdb")
install(FILES "${LIBDIR}/lib${TARGET}.pdb" DESTINATION "${LIBINSTDIR}")
endif()
endfunction()
8 changes: 4 additions & 4 deletions src/grandorgue/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,10 @@ target_link_libraries(golib GrandOrgueImages GrandOrgueCore ${go_libs})
link_directories(${go_libdir})

if (WIN32)
set_source_files_properties("${RESOURCEDIR}/GrandOrgue.rc" PROPERTIES GENERATED "YES")
add_executable(GrandOrgue WIN32 GOApp.cpp "${RESOURCEDIR}/GrandOrgue.rc")
add_dependencies(GrandOrgue resources) # GrandOrgue.rc and GrandOrgue.manifest & GOIcon.ico referenced from GrandOrgue.rc
add_linker_option(GrandOrgue large-address-aware)
set_source_files_properties("${RESOURCEDIR}/GrandOrgue.rc" PROPERTIES GENERATED "YES")
add_executable(GrandOrgue WIN32 GOApp.cpp "${RESOURCEDIR}/GrandOrgue.rc")
add_dependencies(GrandOrgue resources) # GrandOrgue.rc and GrandOrgue.manifest & GOIcon.ico referenced from GrandOrgue.rc
add_linker_option(GrandOrgue large-address-aware)
else ()
add_executable(GrandOrgue GOApp.cpp)
endif ()
Expand Down

0 comments on commit 0908243

Please sign in to comment.