Commit 7164f068 authored by Gargaj's avatar Gargaj
Browse files

fix x64 windows builds

parent 25a3c2a1
......@@ -12,6 +12,16 @@ set(VERSION_MINOR "0")
set(VERSION_PATCH "0")
option(BONZOMATIC_64BIT "Compile for 64 bit target?" ON)
if (MSVC)
if (CMAKE_GENERATOR MATCHES "64")
set(BONZOMATIC_64BIT ON CACHE BOOL "Compile for 64 bit target?")
else ()
set(BONZOMATIC_64BIT OFF CACHE BOOL "Compile for 64 bit target?")
endif ()
else ()
set(BONZOMATIC_64BIT ON CACHE BOOL "Compile for 64 bit target?")
endif ()
set(BONZOMATIC_WINDOWS_FLAVOR "DX11" CACHE STRING "Windows renderer flavor selected at CMake configure time (DX11, DX9 or GLFW)")
set_property(CACHE BONZOMATIC_WINDOWS_FLAVOR PROPERTY STRINGS DX11 DX9 GLFW)
......@@ -90,12 +100,16 @@ if (APPLE)
set(BZC_PROJECT_LIBS ${BZC_PROJECT_LIBS} ${CMAKE_SOURCE_DIR}/external/bass/libbass.dylib)
elseif (UNIX)
if (BONZOMATIC_64BIT)
set(BZC_PROJECT_LIBS ${BZC_PROJECT_LIBS} ${CMAKE_SOURCE_DIR}/external/bass/libbass64.so)
set(BZC_PROJECT_LIBS ${BZC_PROJECT_LIBS} ${CMAKE_SOURCE_DIR}/external/bass/x64/libbass.so)
else ()
set(BZC_PROJECT_LIBS ${BZC_PROJECT_LIBS} ${CMAKE_SOURCE_DIR}/external/bass/libbass.so)
set(BZC_PROJECT_LIBS ${BZC_PROJECT_LIBS} ${CMAKE_SOURCE_DIR}/external/bass/x86/libbass.so)
endif ()
elseif (MSVC)
set(BZC_PROJECT_LIBS ${BZC_PROJECT_LIBS} ${CMAKE_SOURCE_DIR}/external/bass/bass.lib)
if (BONZOMATIC_64BIT)
set(BZC_PROJECT_LIBS ${BZC_PROJECT_LIBS} ${CMAKE_SOURCE_DIR}/external/bass/x64/bass.lib)
else ()
set(BZC_PROJECT_LIBS ${BZC_PROJECT_LIBS} ${CMAKE_SOURCE_DIR}/external/bass/x86/bass.lib)
endif ()
endif ()
##############################################################################
......@@ -410,6 +424,10 @@ target_include_directories(${BZC_EXE_NAME} PUBLIC ${BZC_PROJECT_INCLUDES})
target_link_libraries(${BZC_EXE_NAME} ${BZC_PROJECT_LIBS})
if (MSVC)
add_custom_command(TARGET ${BZC_EXE_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/external/bass/bass.dll" $<TARGET_FILE_DIR:${BZC_EXE_NAME}>)
if (BONZOMATIC_64BIT)
add_custom_command(TARGET ${BZC_EXE_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/external/bass/x64/bass.dll" $<TARGET_FILE_DIR:${BZC_EXE_NAME}>)
elseif ()
add_custom_command(TARGET ${BZC_EXE_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/external/bass/x86/bass.dll" $<TARGET_FILE_DIR:${BZC_EXE_NAME}>)
endif ()
endif ()
......@@ -6,11 +6,21 @@ clone_depth: 50
environment:
matrix:
- flavor: GLFW
x64: OFF
- flavor: GLFW
x64: ON
- flavor: DX9
x64: OFF
- flavor: DX9
x64: ON
- flavor: DX11
x64: OFF
- flavor: DX11
x64: ON
before_build:
- ps: cmake -DBONZOMATIC_64BIT=OFF -DBONZOMATIC_WINDOWS_FLAVOR:STRING="$env:flavor" -G "Visual Studio 12" .
- ps: $env:compiler = @("Visual Studio 12 2013","Visual Studio 12 2013 Win64")[[byte]($env:x64.CompareTo("ON") -eq 0)]
- ps: cmake -DBONZOMATIC_64BIT="$env:x64" -DBONZOMATIC_WINDOWS_FLAVOR:STRING="$env:flavor" -G "$env:compiler" .
build:
project: Bonzomatic.sln
......
......@@ -44,7 +44,7 @@ namespace MIDI
midiInGetDevCaps(i,&caps,sizeof(MIDIINCAPS));
//_tprintf(_T("%d - %d - %d - %08X - %s\n"),i,caps.wMid,caps.wPid,caps.vDriverVersion,caps.szPname);
midiInOpen(&hMIDIInput[i],i,(DWORD)MyMidiInProc,NULL,CALLBACK_FUNCTION);
midiInOpen(&hMIDIInput[i],i,(DWORD_PTR)MyMidiInProc,NULL,CALLBACK_FUNCTION);
midiInStart(hMIDIInput[i]);
}
......
......@@ -10,7 +10,7 @@ class CSetupDialog;
CSetupDialog * pGlobal = NULL;
BOOL CALLBACK DlgFunc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK DlgFunc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
class CSetupDialog
{
......@@ -122,7 +122,7 @@ public:
}
};
BOOL CALLBACK DlgFunc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
INT_PTR CALLBACK DlgFunc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
if (uMsg == WM_INITDIALOG) {
pGlobal = (CSetupDialog *)lParam; // todo: split to multiple hWnd-s! (if needed)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment