Skip to content

Commit fd168b0

Browse files
committed
Fix ChartDirector linking on Linux build
Updated the GitHub Actions workflow to ensure the ChartDirector symlink exists before building. Modified CMakeLists.txt to explicitly add the ChartDirector library directory, link the library, and set the runtime path for proper .so resolution on Linux.
1 parent 66260f8 commit fd168b0

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

.github/workflows/build-linux.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ jobs:
3232
- name: Set up ccache
3333
run: |
3434
ccache --max-size=5G
35-
echo 'export CC="ccache gcc"' >> $GITHUB_ENV
36-
echo 'export CXX="ccache g++"' >> $GITHUB_ENV
35+
echo "CC=ccache gcc" >> $GITHUB_ENV
36+
echo "CXX=ccache g++" >> $GITHUB_ENV
3737
3838
- name: Cache ccache
3939
uses: actions/cache@v3
@@ -43,6 +43,13 @@ jobs:
4343
restore-keys: |
4444
linux-ccache-
4545
46+
- name: Ensure chartdir symlink exists
47+
run: |
48+
cd vendors/chatdir/linux64
49+
if [ ! -e libchartdir.so ]; then
50+
ln -s libchartdir.so.7.0 libchartdir.so
51+
fi
52+
4653
- name: Configure CMake
4754
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
4855

CMakeLists.txt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,20 @@ elseif(UNIX)
105105
wx::ribbon
106106
wx::xml
107107
wx::stc
108-
chartdir
109108
fftw3
110109
)
110+
111+
# ChartDirector
112+
target_link_directories(PSP-UFU PRIVATE
113+
"${CMAKE_SOURCE_DIR}/vendors/chatdir/linux64"
114+
)
115+
116+
target_link_libraries(PSP-UFU PRIVATE chartdir)
117+
118+
# RUNTIME PATH to find .so in runtime
119+
set_target_properties(PSP-UFU PROPERTIES
120+
BUILD_RPATH "${CMAKE_SOURCE_DIR}/vendors/chatdir/linux64"
121+
)
111122
else()
112123
message(FATAL_ERROR "Unsupported platform or architecture")
113124
endif()

0 commit comments

Comments
 (0)