Skip to content

Commit

Permalink
cmake changes:
Browse files Browse the repository at this point in the history
1) always build libappleii as static
2) expose OpenGL as a cmake variable
  • Loading branch information
audetto committed Nov 29, 2021
1 parent 1f1ef6c commit 36ab6a8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 18 deletions.
15 changes: 2 additions & 13 deletions source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -200,16 +200,8 @@ set(HEADER_FILES
Z80VICE/daa.h
)

if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
# Applle's linker does not like the link-time interface of libappleii
# we need link everything at once
message("Mac OS X detected, libappleii as static library")
set(LIBRARY_TYPE "STATIC")
else()
set(LIBRARY_TYPE "SHARED")
endif()

add_library(appleii "${LIBRARY_TYPE}"
# we used to generate a shared object, but it turns out there are more cons than pros
add_library(appleii STATIC
${SOURCE_FILES}
${HEADER_FILES}
)
Expand Down Expand Up @@ -259,6 +251,3 @@ add_custom_command(
)

configure_file(linux/config.h.in linux/config.h)

install(TARGETS appleii
DESTINATION lib)
10 changes: 5 additions & 5 deletions source/frontends/sdl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ set(IMGUI_CLUB_PATH "imgui/imgui_club")
find_package(SDL2 REQUIRED)
pkg_search_module(SDL2_IMAGE REQUIRED SDL2_image)

# the default is to use GLES
set (SA2_USE_OPENGL 0)

if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set (SA2_USE_OPENGL 1)
# only OpenGL supported on MacOS
set (SA2_OPENGL ON)
else()
option(SA2_OPENGL "Prefer OpenGL over OpenGL ES" OFF)
endif()


if (${SA2_USE_OPENGL})
if (SA2_OPENGL)
pkg_search_module(GLES2 REQUIRED opengl)
else()
pkg_search_module(GLES2 REQUIRED glesv2)
Expand Down

0 comments on commit 36ab6a8

Please sign in to comment.