From fb66cced199337b35bd19d6cbdb3782f4978281a Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Wed, 21 Apr 2021 19:32:06 +1000 Subject: [PATCH] ci/cmake: just compile as an object --- .github/workflows/ci.yml | 30 ++++++++++++++---------------- app/CMakeLists.txt | 8 ++++---- tests/CMakeLists.txt | 3 +-- 3 files changed, 19 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b3417751e..3d16cedee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,7 +72,7 @@ jobs: - name: Test working-directory: build run: | - ctest -C ${{ matrix.build-type }} -V + ctest -C ${{ matrix.build-type }} - name: Create Package id: package @@ -91,18 +91,17 @@ jobs: appdir/usr/share/applications/org.olivevideoeditor.Olive.desktop \ -exclude-libs=libQt5Pdf.so,libQt5Qml.so,libQt5QmlModels.so,libQt5Quick.so,libQt5VirtualKeyboard.so \ -bundle-non-qt-libs \ - -executable=appdir/usr/lib/libolive-editor \ -executable=appdir/usr/bin/crashpad_handler \ -executable=appdir/usr/bin/minidump_stackwalk \ -executable=appdir/usr/bin/olive-crashhandler \ --appimage-extract-and-run # Dump Crashpad symbols - dump_syms appdir/usr/lib/libolive-editor.so > libolive-editor.sym + dump_syms appdir/usr/bin/olive-editor > olive-editor.sym # HACK: For some reason, minidump_stackwalk reads identifier as all 0s - SYM_DIR=appdir/usr/share/olive-editor/symbols/libolive-editor.so/000000000000000000000000000000000 + SYM_DIR=appdir/usr/share/olive-editor/symbols/olive-editor/000000000000000000000000000000000 mkdir -p "$SYM_DIR" - mv libolive-editor.sym "$SYM_DIR" + mv olive-editor.sym "$SYM_DIR" # Package AppImage $DOWNLOAD_TOOL https://github.com/AppImage/AppImageKit/releases/download/12/appimagetool-x86_64.AppImage @@ -199,7 +198,7 @@ jobs: working-directory: ${{ runner.workspace }}/build shell: bash run: | - ctest -C ${{ matrix.build-type }} -V + ctest -C ${{ matrix.build-type }} - name: Create Package working-directory: ${{ runner.workspace }}/build @@ -209,9 +208,8 @@ jobs: run: | mkdir olive-editor cp app/olive-editor.exe olive-editor - cp app/crashhandler/olive-crashhandler.exe olive-editor + cp app/olive-crashhandler.exe olive-editor cp app/olive-editor.pdb olive-editor - cp app/libolive-editor.pdb olive-editor $DEP_LOCATION/bin/windeployqt olive-editor/olive-crashhandler.exe $DEP_LOCATION/bin/windeployqt olive-editor/olive-editor.exe cp $(cygpath $DEP_LOCATION)/bin/*.dll olive-editor @@ -223,11 +221,11 @@ jobs: shell: bash run: | curl -fLSs https://github.com/google/breakpad/blob/master/src/tools/windows/binaries/dump_syms.exe?raw=true > dump_syms.exe - ./dump_syms app/libolive-editor.pdb > libolive-editor.sym - SYM_HEADER=($(head -n 1 libolive-editor.sym)) # Read first line of symbol file - SYM_DIR=olive-editor/symbols/libolive-editor.pdb/${SYM_HEADER[3]} + ./dump_syms app/olive-editor.pdb > olive-editor.sym + SYM_HEADER=($(head -n 1 olive-editor.sym)) # Read first line of symbol file + SYM_DIR=olive-editor/symbols/olive-editor.pdb/${SYM_HEADER[3]} mkdir -p "$SYM_DIR" - mv libolive-editor.sym "$SYM_DIR" + mv olive-editor.sym "$SYM_DIR" - name: Deploy Packages working-directory: ${{ runner.workspace }}/build @@ -340,7 +338,7 @@ jobs: working-directory: ${{ runner.workspace }}/build shell: bash run: | - ctest -C ${{ matrix.build-type }} -V + ctest -C ${{ matrix.build-type }} - name: Create Package working-directory: ${{ runner.workspace }}/build @@ -363,9 +361,9 @@ jobs: install_name_tool -change libmodplug.dylib @rpath/libmodplug.dylib $BUNDLE_NAME/Contents/Frameworks/libavfilter.* # Crashpad symbols - $DEP_LOCATION/bin/dump_syms $BUNDLE_NAME/Contents/Resources/libolive-editor.dylib > libolive-editor.sym - SYM_HEADER=($(head -n 1 libolive-editor.sym)) # Read first line of symbol file - SYM_DIR=$BUNDLE_NAME/Contents/Resources/symbols/libolive-editor.dylib/${SYM_HEADER[3]} + $DEP_LOCATION/bin/dump_syms $BUNDLE_NAME/Contents/MacOS/Olive > Olive.sym + SYM_HEADER=($(head -n 1 Olive.sym)) # Read first line of symbol file + SYM_DIR=$BUNDLE_NAME/Contents/Resources/symbols/Olive/${SYM_HEADER[3]} mkdir -p "$SYM_DIR" mv Olive.sym "$SYM_DIR" diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index f06eaf88a..db3732594 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -46,7 +46,7 @@ add_subdirectory(window) # Add main library add_library(libolive-editor - SHARED + OBJECT ${OLIVE_SOURCES} ${OLIVE_RESOURCES} ) @@ -57,6 +57,7 @@ set_target_properties(libolive-editor PROPERTIES PREFIX "") # Add applicaton add_executable(olive-editor main.cpp + $ ) # Create docs if doxygen was found @@ -83,17 +84,16 @@ elseif(APPLE) MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/packaging/macos/MacOSXBundleInfo.plist.in MACOSX_BUNDLE_GUI_IDENTIFIER org.olivevideoeditor.Olive MACOSX_BUNDLE_ICON_FILE olive.icns - RESOURCE "${OLIVE_ICON} libolive-editor" + RESOURCE "${OLIVE_ICON}" OUTPUT_NAME "Olive" ) elseif(UNIX) # Set Linux-specific properties for application install(TARGETS olive-editor RUNTIME DESTINATION bin) - install(TARGETS libolive-editor RUNTIME DESTINATION lib) endif() # Set link libraries -target_link_libraries(olive-editor PRIVATE libolive-editor ${OLIVE_LIBRARIES}) +target_link_libraries(olive-editor PRIVATE ${OLIVE_LIBRARIES}) target_link_libraries(libolive-editor PRIVATE ${OLIVE_LIBRARIES}) # Set compile options diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 59a0f8441..798d41583 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -39,7 +39,7 @@ function(olive_add_test GROUP NAME SOURCE) string(APPEND TEST_FILE_CONTENT "\n${TEST_BODY}") file(WRITE "${OUTPUT_FILE}" "${TEST_FILE_CONTENT}") - add_executable(${NAME} ${OUTPUT_FILE}) + add_executable(${NAME} ${OUTPUT_FILE} $) target_include_directories( ${NAME} PRIVATE @@ -49,7 +49,6 @@ function(olive_add_test GROUP NAME SOURCE) target_link_libraries( ${NAME} PRIVATE - libolive-editor ${OLIVE_LIBRARIES} ) target_compile_definitions(