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
|
- name: Install vcpkg dependencies
|
||||||
run: |
|
run: |
|
||||||
vcpkg install sdl2 fftw3 libsndfile --triplet x64-windows
|
vcpkg install sdl2 fftw3 "libsndfile[core]" --triplet x64-windows
|
||||||
|
|
||||||
- name: Configure
|
- name: Configure
|
||||||
run: >
|
run: >
|
||||||
|
|||||||
@@ -180,12 +180,31 @@ if(EMSCRIPTEN)
|
|||||||
else()
|
else()
|
||||||
# ── Native Build ─────────────────────────────────────────────────────────
|
# ── Native Build ─────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
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_RELEASE "-O3 -march=native -DNDEBUG")
|
||||||
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -fsanitize=address,undefined")
|
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -fsanitize=address,undefined")
|
||||||
|
endif()
|
||||||
|
|
||||||
find_package(PkgConfig REQUIRED)
|
|
||||||
find_package(OpenGL REQUIRED)
|
find_package(OpenGL REQUIRED)
|
||||||
|
|
||||||
|
if(MSVC)
|
||||||
|
find_package(SDL2 CONFIG REQUIRED)
|
||||||
|
find_package(FFTW3f CONFIG REQUIRED)
|
||||||
|
find_package(SndFile CONFIG REQUIRED)
|
||||||
|
|
||||||
|
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 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(SDL2 REQUIRED IMPORTED_TARGET sdl2)
|
||||||
pkg_check_modules(FFTW3F REQUIRED IMPORTED_TARGET fftw3f)
|
pkg_check_modules(FFTW3F REQUIRED IMPORTED_TARGET fftw3f)
|
||||||
pkg_check_modules(SNDFILE REQUIRED IMPORTED_TARGET sndfile)
|
pkg_check_modules(SNDFILE REQUIRED IMPORTED_TARGET sndfile)
|
||||||
@@ -195,17 +214,13 @@ else()
|
|||||||
add_executable(baudmine ${SOURCES})
|
add_executable(baudmine ${SOURCES})
|
||||||
target_include_directories(baudmine PRIVATE src)
|
target_include_directories(baudmine PRIVATE src)
|
||||||
target_link_libraries(baudmine PRIVATE
|
target_link_libraries(baudmine PRIVATE
|
||||||
imgui
|
imgui PkgConfig::SDL2 PkgConfig::FFTW3F
|
||||||
PkgConfig::SDL2
|
PkgConfig::SNDFILE OpenGL::GL pthread
|
||||||
PkgConfig::FFTW3F
|
|
||||||
PkgConfig::SNDFILE
|
|
||||||
OpenGL::GL
|
|
||||||
pthread
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Link math library and dl on Unix (dl needed by miniaudio for backend loading)
|
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
target_link_libraries(baudmine PRIVATE m dl)
|
target_link_libraries(baudmine PRIVATE m dl)
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -30,6 +30,9 @@ EM_JS(void, js_clearCanvasInlineSize, (), {
|
|||||||
if (c) { c.style.width = ''; c.style.height = ''; }
|
if (c) { c.style.width = ''; c.style.height = ''; }
|
||||||
});
|
});
|
||||||
|
|
||||||
|
#elif defined(_WIN32)
|
||||||
|
#include <windows.h>
|
||||||
|
#include <GL/gl.h>
|
||||||
#else
|
#else
|
||||||
#include <GL/gl.h>
|
#include <GL/gl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -4,6 +4,9 @@
|
|||||||
|
|
||||||
#ifdef __EMSCRIPTEN__
|
#ifdef __EMSCRIPTEN__
|
||||||
#include <GLES2/gl2.h>
|
#include <GLES2/gl2.h>
|
||||||
|
#elif defined(_WIN32)
|
||||||
|
#include <windows.h>
|
||||||
|
#include <GL/gl.h>
|
||||||
#else
|
#else
|
||||||
#include <GL/gl.h>
|
#include <GL/gl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
#include "core/Types.h"
|
#include "core/Types.h"
|
||||||
#include "ui/ColorMap.h"
|
#include "ui/ColorMap.h"
|
||||||
|
#ifdef _WIN32
|
||||||
|
#include <windows.h>
|
||||||
|
#endif
|
||||||
#include <GL/gl.h>
|
#include <GL/gl.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <deque>
|
#include <deque>
|
||||||
|
|||||||
Reference in New Issue
Block a user