Skip to content

Conversation

@yes7rose
Copy link

add support macosx premake option

Copy link
Author

@yes7rose yes7rose left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested on macos 13.6, apple clang 15 with gmake

Copy link
Owner

@utelle utelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In its current form I can't accept the PR, because it is too specific for your personal development environment and doesn't distinguish cleanly between compiler and platform specific options. For example, it breaks the build support for gcc on Windows platforms.

Build support for MacOS is already available via autoconf/automake.

local function wxSetTargetDirectory(arch, build)
-- Target directory
if (is_msvc) then
if arch == "MacOsx" then
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MacOsx is not an architecture, but a platform or system. You are dropping the compiler-specific part from the path, but even on MacOS you could use different compilers like gcc or clang.


filter { "platforms:MacOsx" }
system "macosx"
architecture "x64"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When adding MacOS support it should not be restricted to x64. Modern MacOS computers would require ARM64 support.

filter { "configurations:Debug", "platforms:Win64" }
wx_config {Unicode="yes", Version=_OPTIONS["wx_ver"], Static="yes", Debug="yes", Arch="Win64", WindowsCompiler=wx_compiler, Libs=wxlibs }
filter { "configurations:Debug", "platforms:MacOsx" }
wx_config {Unicode="yes", Version=_OPTIONS["wx_ver"], Static="yes", Debug="yes", Libs=wxlibs, Root="/Users/wangrongwen/cpp/wxtest/wxlib" }
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you are using an absolute path for Root containing your personal user id. This is not acceptable for generic build support.

filter { "configurations:Release wxDLL", "platforms:Win64" }
wx_config {Unicode="yes", Version=_OPTIONS["wx_ver"], Static="no", Debug="no", Arch="Win64", WindowsCompiler=wx_compiler, Libs=wxlibs }
filter { "configurations:Release wxDLL", "platforms:MacOsx" }
wx_config {Unicode="yes", Version=_OPTIONS["wx_ver"], Static="no", Debug="no", Libs=wxlibs, Root="../wxlib" }
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most likely the relative path for Root is also specific for your personal environment setup.

workspace "wxsqlite3"
configurations { "Debug", "Release", "Debug wxDLL", "Release wxDLL", "Debug DLL", "Release DLL" }
platforms { "Win32", "Win64" }
platforms { "Win32", "Win64", "MacOsx" }
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Premake has no predefined platforms. Here platform names could be for example something like MacOS_x64 or MacOS_ARM64.

"_FILE_OFFSET_BITS=64"
}

if (is_msvc) then
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This statement makes the following defines compiler-specific. That is wrong. On Windows the same defines are relevant for the gcc compiler as well.

@yes7rose yes7rose closed this Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants