diff --git a/default.nix b/default.nix index d85025fe..25808174 100644 --- a/default.nix +++ b/default.nix @@ -2,7 +2,7 @@ with import {}; stdenv.mkDerivation { name = "visualboyadvance-m"; buildInputs = if stdenv.isDarwin then - [ ninja cmake gcc nasm gettext pkg-config zip sfml zlib openal ffmpeg wxGTK32 SDL2 pcre pcre2 ] + [ ninja cmake gcc nasm gettext pkg-config zip sfml zlib openal ffmpeg wxGTK32 SDL2 pcre pcre2 darwin.apple_sdk.frameworks.IOKit darwin.apple_sdk.frameworks.Carbon darwin.apple_sdk.frameworks.Cocoa darwin.apple_sdk.frameworks.QuartzCore darwin.apple_sdk.frameworks.AudioToolbox darwin.apple_sdk.frameworks.OpenGL darwin.apple_sdk.frameworks.OpenAL ] else [ ninja cmake gcc nasm gettext pkg-config zip sfml zlib openal ffmpeg wxGTK32 mesa glfw SDL2 gtk3-x11 pcre pcre2 util-linuxMinimal libselinux libsepol libthai libdatrie xorg.libXdmcp xorg.libXtst libxkbcommon epoxy dbus at-spi2-core ]; } diff --git a/src/wx/CMakeLists.txt b/src/wx/CMakeLists.txt index 8d936774..e9d39ef2 100644 --- a/src/wx/CMakeLists.txt +++ b/src/wx/CMakeLists.txt @@ -259,7 +259,7 @@ else() include_directories(${wxWidgets_INCLUDE_DIRS}) - if(CMAKE_BUILD_TYPE MATCHES "^(Debug|RelWithDebInfo)$") + if(CMAKE_BUILD_TYPE STREQUAL Debug) # tell wx to enable debug mode if possible, if the cmake module did not do it for us execute_process(COMMAND "${wxWidgets_CONFIG_EXECUTABLE} --debug=yes" RESULT_VARIABLE WX_CONFIG_DEBUG OUTPUT_QUIET ERROR_QUIET) @@ -279,6 +279,17 @@ else() add_compile_options(${CXX_COMPILE_FLAG}) endforeach() + # Remove "-framework System" from libs on macOS, it's not necessary and nix doesn't have it. + if(APPLE) + unset(tmp_libs) + foreach(lib ${wxWidgets_LIBRARIES}) + if(NOT lib STREQUAL "-framework System") + list(APPEND tmp_libs "${lib}") + endif() + endforeach() + set(wxWidgets_LIBRARIES "${tmp_libs}") + endif() + # set up variables for some compile/run checks for wxWidgets set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${MY_CXX_FLAGS} ${MY_C_FLAGS} ${MY_CXX_LINKER_FLAGS} ${MY_C_LINKER_FLAGS} ${wxWidgets_LIBRARIES}) set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} ${wxWidgets_CXX_FLAGS} ${MY_CXX_FLAGS} ${MY_C_FLAGS})