Skip to content

Commit

Permalink
fix(ci): install latest clang version
Browse files Browse the repository at this point in the history
  • Loading branch information
f0e committed Dec 1, 2024
1 parent 900ffa9 commit 9ab7dc7
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 27 deletions.
31 changes: 23 additions & 8 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest] #, macos-latest, windows-latest]
build-type: [release]

steps:
Expand All @@ -17,24 +17,37 @@ jobs:
with:
submodules: recursive

- name: Install LLVM Repository
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 19
# Install system dependencies for Linux
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y \
libx11-dev \
libxcursor-dev \
libxinerama-dev \
libxi-dev \
libxrandr-dev \
libgl1-mesa-dev
libc++-dev libc++abi-dev \
libpixman-1-dev libfreetype6-dev libharfbuzz-dev zlib1g-dev \
libx11-dev libxcursor-dev libxi-dev libgl1-mesa-dev \
libpthread-stubs0-dev
- name: Set up LLVM and Clang paths
run: |
echo "/usr/lib/llvm-19/bin" >> $GITHUB_PATH
echo "CC=/usr/bin/clang-19" >> $GITHUB_ENV
echo "CXX=/usr/bin/clang++-19" >> $GITHUB_ENV
- name: Debug LLVM Version
run: clang++ --version

# Install Ninja
- name: Install Ninja
uses: seanmiddleditch/gha-setup-ninja@master
with:
version: 1.11.1
version: 1.12.1

# Setup vcpkg
- name: Setup vcpkg
Expand Down Expand Up @@ -66,6 +79,8 @@ jobs:
run: cmake --preset ${{ steps.select-preset.outputs.preset }}
env:
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
CMAKE_THREAD_LIBS_INIT: -pthread
THREADS_PREFER_PTHREAD_FLAG: ON

# Build the project
- name: Build
Expand Down
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ function(setup_target target)
${target}
PRIVATE nlohmann_json::nlohmann_json
Boost::system
Boost::filesystem)
Boost::filesystem
Threads::Threads)
target_compile_definitions(
${target}
PRIVATE NOMINMAX
Expand Down
6 changes: 4 additions & 2 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@
"value": "MultiThreadedDLL"
},
"CMAKE_C_COMPILER": "clang",
"CMAKE_CXX_COMPILER": "clang++"
"CMAKE_CXX_COMPILER": "clang++",
"CMAKE_CXX_FLAGS": "-stdlib=libc++",
"CMAKE_EXE_LINKER_FLAGS": "-stdlib=libc++"
},
"generator": "Ninja"
},
Expand Down Expand Up @@ -134,4 +136,4 @@
"jobs": 0
}
]
}
}
4 changes: 2 additions & 2 deletions src/gui/gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ void gui::update_vsync() {
void* screen_handle = window->screen()->nativeHandle();
static void* last_screen_handle;
#else
int screen_handle = (int)window->screen()->nativeHandle();
static int last_screen_handle;
intptr_t screen_handle = (intptr_t)window->screen()->nativeHandle();
static intptr_t last_screen_handle;
#endif

if (screen_handle != last_screen_handle) {
Expand Down
26 changes: 13 additions & 13 deletions src/gui/ui/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ double utils::get_display_refresh_rate(HMONITOR hMonitor)
#elif defined(__APPLE__)
double utils::get_display_refresh_rate(void* nsScreen) // Take NSScreen* as void* to avoid Obj-C++ dependency
#else
double utils::get_display_refresh_rate(int screenNumber)
double utils::get_display_refresh_rate(intptr_t screenNumber)
#endif
{
#ifdef _WIN32
Expand Down Expand Up @@ -138,13 +138,13 @@ bool utils::show_file_selector( // aseprite
dlg->setDefaultExtension(def_extension);
}

#if LAF_LINUX // As the X11 version doesn't store the default path to
// start navigating, we use our own
// get_initial_path_to_select_filename()
dlg->setFileName(get_initial_path_to_select_filename(initialPath));
#else // !LAF_LINUX
dlg->setFileName(initial_path);
#endif
// #if LAF_LINUX // As the X11 version doesn't store the default path to
// // start navigating, we use our own
// // get_initial_path_to_select_filename()
// dlg->setFileName(get_initial_path_to_select_filename(initialPath));
// #else // !LAF_LINUX
// dlg->setFileName(initial_path);
// #endif

dlg->setType(type);

Expand All @@ -159,11 +159,11 @@ bool utils::show_file_selector( // aseprite
else
output.push_back(dlg->fileName());

#if LAF_LINUX // Save the path in the configuration file
if (!output.empty()) {
set_current_dir_for_file_selector(base::get_file_path(output[0]));
}
#endif
// #if LAF_LINUX // Save the path in the configuration file
// if (!output.empty()) {
// set_current_dir_for_file_selector(base::get_file_path(output[0]));
// }
// #endif

return true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/gui/ui/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace utils {
#elif defined(__APPLE__)
double get_display_refresh_rate(void* nsScreen);
#else
double get_display_refresh_rate(int screenNumber);
double get_display_refresh_rate(intptr_t screenNumber);
#endif
// NOLINTEND

Expand Down

0 comments on commit 9ab7dc7

Please sign in to comment.