Skip to content

Commit df32e56

Browse files
authored
Merge pull request AppleWin#221 from audetto/fixes
A few simple Win32 fixes.
2 parents 2c1e541 + 37d338c commit df32e56

File tree

13 files changed

+41
-20
lines changed

13 files changed

+41
-20
lines changed

CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,12 @@ include_directories(source)
4949

5050
add_subdirectory(source)
5151
add_subdirectory(resource)
52-
add_subdirectory(source/linux/libwindows)
5352
add_subdirectory(test/TestCPU6502)
5453

54+
if (NOT WIN32)
55+
add_subdirectory(source/linux/libwindows)
56+
endif()
57+
5558
if (BUILD_LIBRETRO OR BUILD_APPLEN OR BUILD_SA2)
5659
add_subdirectory(source/frontends/common2)
5760
endif()

source/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,11 @@ target_link_libraries(appleii PRIVATE
272272
ZLIB::ZLIB
273273
)
274274

275-
target_link_libraries(appleii PUBLIC
276-
windows
277-
)
275+
if (NOT WIN32)
276+
target_link_libraries(appleii PUBLIC
277+
windows
278+
)
279+
endif()
278280

279281
target_link_directories(appleii PRIVATE
280282
${YAML_LIBRARY_DIRS}

source/frontends/common2/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,15 @@ target_include_directories(common2 PRIVATE
4444

4545
target_link_libraries(common2 PRIVATE
4646
appleii
47-
windows
4847
apple2roms
4948
)
5049

50+
if (NOT WIN32)
51+
target_link_libraries(common2 PUBLIC
52+
windows
53+
)
54+
endif()
55+
5156
file(RELATIVE_PATH ROOT_PATH ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR})
5257
if ("${ROOT_PATH}" STREQUAL "")
5358
# if the 2 paths are the same

source/frontends/libretro/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,14 @@ target_link_libraries(applewin_libretro PRIVATE
5151
$<${static_stdcpp_fs}:stdc++fs>
5252
appleii
5353
common2
54-
windows
5554
)
5655

56+
if (NOT WIN32)
57+
target_link_libraries(applewin_libretro PUBLIC
58+
windows
59+
)
60+
endif()
61+
5762
# just call it "applewin_libretro.so" as per libretro standard
5863
set_target_properties(applewin_libretro PROPERTIES PREFIX "")
5964

source/frontends/libretro/game.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include "frontends/common2/ptreeregistry.h"
88
#include "frontends/common2/programoptions.h"
99

10+
#include "Registry.h"
1011
#include "Common.h"
1112
#include "Interface.h"
1213

source/frontends/libretro/retroregistry.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include "frontends/common2/ptreeregistry.h"
44
#include "frontends/libretro/environment.h"
55

6+
#include "Registry.h"
67
#include "Common.h"
78
#include "Card.h"
89
#include "Video.h"

source/frontends/qt/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,15 @@ target_link_libraries(qapple PRIVATE
7070
Qt::Multimedia
7171
appleii
7272
QHexView
73-
windows
7473
apple2roms
7574
)
7675

76+
if (NOT WIN32)
77+
target_link_libraries(qapple PUBLIC
78+
windows
79+
)
80+
endif()
81+
7782
if(Qt5_FOUND)
7883
target_sources(qapple PRIVATE
7984
gamepadpaddle.cpp

source/frontends/sdl/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,14 @@ target_link_libraries(sa2 PRIVATE
6363
OpenGL::GL
6464
appleii
6565
common2
66-
windows
6766
)
6867

68+
if (NOT WIN32)
69+
target_link_libraries(sa2 PUBLIC
70+
windows
71+
)
72+
endif()
73+
6974
target_link_directories(sa2 PRIVATE
7075
${SDL2_LIBRARY_DIRS}
7176
${SDL2_IMAGE_LIBRARY_DIRS}

source/linux/linuxframe.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ LinuxFrame::LinuxFrame(const bool autoBoot) : myAutoBoot(autoBoot)
6767
{
6868
const std::array<int, 4> version = getVersionNumbers();
6969
SetAppleWinVersion(version[0], version[1], version[2], version[3]);
70-
g_hFrameWindow = this;
7170
}
7271

7372
void LinuxFrame::Initialize(bool resetVideoState)
@@ -178,7 +177,9 @@ std::shared_ptr<NetworkBackend> LinuxFrame::CreateNetworkBackend(const std::stri
178177
#endif
179178
}
180179

180+
#ifndef _WIN32
181181
int MessageBox(HWND, LPCSTR lpText, LPCSTR lpCaption, UINT uType)
182182
{
183183
return GetFrame().FrameMessageBox(lpText, lpCaption, uType);
184184
}
185+
#endif

source/linux/linuxframe.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,3 @@ class LinuxFrame : public FrameBase
5454

5555
bool myAutoBoot; // non const to allow settings change
5656
};
57-
58-
int MessageBox(HWND, LPCSTR lpText, LPCSTR lpCaption, UINT uType);

0 commit comments

Comments
 (0)