CI/CD: fix for Windows
This commit is contained in:
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@@ -46,7 +46,7 @@ jobs:
|
||||
|
||||
- name: Install vcpkg dependencies
|
||||
run: |
|
||||
vcpkg install sdl2 fftw3 libsndfile --triplet x64-windows
|
||||
vcpkg install sdl2 fftw3 "libsndfile[core]" --triplet x64-windows
|
||||
|
||||
- name: Configure
|
||||
run: >
|
||||
|
||||
@@ -180,32 +180,47 @@ if(EMSCRIPTEN)
|
||||
else()
|
||||
# ── Native Build ─────────────────────────────────────────────────────────
|
||||
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -march=native -DNDEBUG")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -fsanitize=address,undefined")
|
||||
if(MSVC)
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "/O2 /DNDEBUG")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "/Zi /Od")
|
||||
else()
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -march=native -DNDEBUG")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -fsanitize=address,undefined")
|
||||
endif()
|
||||
|
||||
find_package(PkgConfig REQUIRED)
|
||||
find_package(OpenGL REQUIRED)
|
||||
|
||||
pkg_check_modules(SDL2 REQUIRED IMPORTED_TARGET sdl2)
|
||||
pkg_check_modules(FFTW3F REQUIRED IMPORTED_TARGET fftw3f)
|
||||
pkg_check_modules(SNDFILE REQUIRED IMPORTED_TARGET sndfile)
|
||||
if(MSVC)
|
||||
find_package(SDL2 CONFIG REQUIRED)
|
||||
find_package(FFTW3f CONFIG REQUIRED)
|
||||
find_package(SndFile CONFIG REQUIRED)
|
||||
|
||||
target_link_libraries(imgui PUBLIC PkgConfig::SDL2 OpenGL::GL)
|
||||
target_link_libraries(imgui PUBLIC SDL2::SDL2 OpenGL::GL)
|
||||
|
||||
add_executable(baudmine ${SOURCES})
|
||||
target_include_directories(baudmine PRIVATE src)
|
||||
target_link_libraries(baudmine PRIVATE
|
||||
imgui
|
||||
PkgConfig::SDL2
|
||||
PkgConfig::FFTW3F
|
||||
PkgConfig::SNDFILE
|
||||
OpenGL::GL
|
||||
pthread
|
||||
)
|
||||
add_executable(baudmine ${SOURCES})
|
||||
target_include_directories(baudmine PRIVATE src)
|
||||
target_link_libraries(baudmine PRIVATE
|
||||
imgui SDL2::SDL2 SDL2::SDL2main
|
||||
FFTW3::fftw3f SndFile::sndfile OpenGL::GL
|
||||
)
|
||||
else()
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(SDL2 REQUIRED IMPORTED_TARGET sdl2)
|
||||
pkg_check_modules(FFTW3F REQUIRED IMPORTED_TARGET fftw3f)
|
||||
pkg_check_modules(SNDFILE REQUIRED IMPORTED_TARGET sndfile)
|
||||
|
||||
# Link math library and dl on Unix (dl needed by miniaudio for backend loading)
|
||||
if(UNIX)
|
||||
target_link_libraries(baudmine PRIVATE m dl)
|
||||
target_link_libraries(imgui PUBLIC PkgConfig::SDL2 OpenGL::GL)
|
||||
|
||||
add_executable(baudmine ${SOURCES})
|
||||
target_include_directories(baudmine PRIVATE src)
|
||||
target_link_libraries(baudmine PRIVATE
|
||||
imgui PkgConfig::SDL2 PkgConfig::FFTW3F
|
||||
PkgConfig::SNDFILE OpenGL::GL pthread
|
||||
)
|
||||
|
||||
if(UNIX)
|
||||
target_link_libraries(baudmine PRIVATE m dl)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
@@ -30,6 +30,9 @@ EM_JS(void, js_clearCanvasInlineSize, (), {
|
||||
if (c) { c.style.width = ''; c.style.height = ''; }
|
||||
});
|
||||
|
||||
#elif defined(_WIN32)
|
||||
#include <windows.h>
|
||||
#include <GL/gl.h>
|
||||
#else
|
||||
#include <GL/gl.h>
|
||||
#endif
|
||||
|
||||
@@ -4,6 +4,9 @@
|
||||
|
||||
#ifdef __EMSCRIPTEN__
|
||||
#include <GLES2/gl2.h>
|
||||
#elif defined(_WIN32)
|
||||
#include <windows.h>
|
||||
#include <GL/gl.h>
|
||||
#else
|
||||
#include <GL/gl.h>
|
||||
#endif
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
|
||||
#include "core/Types.h"
|
||||
#include "ui/ColorMap.h"
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#endif
|
||||
#include <GL/gl.h>
|
||||
#include <vector>
|
||||
#include <deque>
|
||||
|
||||
Reference in New Issue
Block a user