diff --git a/native/MacScreenMenu/CMakeLists.txt b/native/MacScreenMenu/CMakeLists.txt index 2e39992d3834..7df1d05ae095 100644 --- a/native/MacScreenMenu/CMakeLists.txt +++ b/native/MacScreenMenu/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.21) project(MacScreenMenu OBJC) if(NOT APPLE) @@ -18,8 +18,8 @@ endif () include_directories(${JAVA_HOME}/include ${JAVA_HOME}/include/darwin) add_compile_options("-fmodules" "-flto=full" "-Wall" "-Wextra" "-Wpedantic" "-Wno-newline-eof" "-Wno-unused-parameter") -add_library(${MY_LIB_NAME} SHARED +add_library(macscreenmenu64 SHARED src/MenuItem.h src/MenuItem.m src/Menu.m src/CustomMenuItemView.h src/CustomMenuItemView.m src/Menu.h) -install(FILES $ DESTINATION ${CMAKE_CURRENT_LIST_DIR}/../../bin/mac) +install(FILES $ DESTINATION ${CMAKE_CURRENT_LIST_DIR}/../../bin/mac) diff --git a/native/MacScreenMenu/make.sh b/native/MacScreenMenu/make.sh index c9eaf66aa43c..8c15f51628cb 100755 --- a/native/MacScreenMenu/make.sh +++ b/native/MacScreenMenu/make.sh @@ -1,23 +1,13 @@ #!/bin/sh -MY_LIB_NAME=macscreenmenu64 - rm -rf build mkdir build cd build || exit 1 -# -G "Unix Makefiles" does not build a universal binary -cmake -DMY_LIB_NAME=${MY_LIB_NAME} -G "Xcode" .. || exit 2 +cmake -DCMAKE_BUILD_TYPE=Release .. || exit 2 + +make VERBOSE=1 || exit 3 if [ "$1" = "install" ]; then - MY_TARGET="install" - MY_STRIP="YES" -else - MY_TARGET=${MY_LIB_NAME} - MY_STRIP="NO" + make install/strip VERBOSE=1 || exit 4 fi - -STRIP_INSTALLED_PRODUCT = YES -STRIP_STYLE = non-global - -xcodebuild -target ${MY_TARGET} -configuration Release STRIP_INSTALLED_PRODUCT=${MY_STRIP} STRIP_STYLE=non-global || exit 3