132132
133133local function wxSetTargetDirectory (arch , build )
134134 -- Target directory
135- if (is_msvc ) then
135+ if arch == " MacOsx" then
136+ targetdir (BUILDDIR .. " /bin/macOS/" .. build )
137+ elseif (is_msvc ) then
136138 targetdir (BUILDDIR .. " /bin/" .. vc_with_ver .. " /" .. arch .. " /" .. build )
137139 else
138140 targetdir (BUILDDIR .. " /bin/gcc" .. " /" .. arch .. " /" .. build )
@@ -323,6 +325,11 @@ function wx_config_Private(wxRoot, wxDebug, wxHost, wxVersion, wxStatic, wxUnico
323325 function wx_config_for_posix ()
324326 local configCmd = " wx-config" -- this is the wx-config command ligne
325327 if wxRoot ~= " " then configCmd = path .join (wxRoot , " bin/wx-config" ) end
328+
329+ -- Add macOS specific defines
330+ if os .target () == " macosx" then
331+ defines { " __WXMAC__" , " __WXOSX__" , " __WXOSX_COCOA__" }
332+ end
326333
327334 local function checkYesNo (value , option )
328335 if value == " " then return " " end
@@ -380,6 +387,10 @@ function init_filters()
380387 system " Windows"
381388 architecture " x64"
382389
390+ filter { " platforms:MacOsx" }
391+ system " macosx"
392+ architecture " x64"
393+
383394 filter { " configurations:Debug*" }
384395 defines {
385396 " DEBUG" ,
@@ -409,6 +420,11 @@ function make_filters(libname,libtarget,wxlibs)
409420 else
410421 targetname (libtarget .. " $(wxFlavour)" )
411422 end
423+
424+ -- Override targetname for macOS platform
425+ filter { " platforms:MacOsx" }
426+ targetname (libtarget )
427+ filter {}
412428
413429 if (is_msvc ) then
414430 defines {
@@ -419,6 +435,13 @@ function make_filters(libname,libtarget,wxlibs)
419435 libname .. " _DLLNAME=" .. libtarget .. " $(wxSuffixDebug)"
420436 }
421437 end
438+
439+ -- Override DLLNAME for macOS platform
440+ filter { " platforms:MacOsx" }
441+ defines {
442+ libname .. " _DLLNAME=" .. libtarget .. " $(wxSuffixDebug)"
443+ }
444+ filter {}
422445
423446 makesettings { " include config.gcc" }
424447
@@ -481,6 +504,8 @@ function make_filters(libname,libtarget,wxlibs)
481504 else
482505 targetdir (" lib/gcc_x64_lib_wxdll" )
483506 end
507+ filter { " configurations:Release or Debug or Release wxDLL or Debug wxDLL" , " platforms:MacOsx" }
508+ targetdir (" lib/macOS_lib" )
484509
485510 filter { " configurations:Release DLL or Debug DLL" }
486511 kind " SharedLib"
@@ -514,6 +539,8 @@ function make_filters(libname,libtarget,wxlibs)
514539 else
515540 targetdir (" lib/gcc_x64_dll" )
516541 end
542+ filter { " configurations:Release DLL or Debug DLL" , " platforms:MacOsx" }
543+ targetdir (" lib/macOS_dll" )
517544
518545 filter { " configurations:Debug*" }
519546 targetsuffix " d"
@@ -525,31 +552,43 @@ function make_filters(libname,libtarget,wxlibs)
525552 wx_config {Unicode = " yes" , Version = _OPTIONS [" wx_ver" ], Static = " yes" , Debug = " yes" , WindowsCompiler = wx_compiler , Libs = wxlibs }
526553 filter { " configurations:Debug" , " platforms:Win64" }
527554 wx_config {Unicode = " yes" , Version = _OPTIONS [" wx_ver" ], Static = " yes" , Debug = " yes" , Arch = " Win64" , WindowsCompiler = wx_compiler , Libs = wxlibs }
555+ filter { " configurations:Debug" , " platforms:MacOsx" }
556+ wx_config {Unicode = " yes" , Version = _OPTIONS [" wx_ver" ], Static = " yes" , Debug = " yes" , Libs = wxlibs , Root = " /Users/wangrongwen/cpp/wxtest/wxlib" }
528557
529558 filter { " configurations:Debug wxDLL" , " platforms:Win32" }
530559 wx_config {Unicode = " yes" , Version = _OPTIONS [" wx_ver" ], Static = " no" , Debug = " yes" , WindowsCompiler = wx_compiler , Libs = wxlibs }
531560 filter { " configurations:Debug wxDLL" , " platforms:Win64" }
532561 wx_config {Unicode = " yes" , Version = _OPTIONS [" wx_ver" ], Static = " no" , Debug = " yes" , Arch = " Win64" , WindowsCompiler = wx_compiler , Libs = wxlibs }
562+ filter { " configurations:Debug wxDLL" , " platforms:MacOsx" }
563+ wx_config {Unicode = " yes" , Version = _OPTIONS [" wx_ver" ], Static = " no" , Debug = " yes" , Libs = wxlibs , Root = " /Users/wangrongwen/cpp/wxtest/wxlib" }
533564
534565 filter { " configurations:Debug DLL" , " platforms:Win32" }
535566 wx_config {Unicode = " yes" , Version = _OPTIONS [" wx_ver" ], Static = " no" , Debug = " yes" , WindowsCompiler = wx_compiler , Libs = wxlibs }
536567 filter { " configurations:Debug DLL" , " platforms:Win64" }
537568 wx_config {Unicode = " yes" , Version = _OPTIONS [" wx_ver" ], Static = " no" , Debug = " yes" , Arch = " Win64" , WindowsCompiler = wx_compiler , Libs = wxlibs }
569+ filter { " configurations:Debug DLL" , " platforms:MacOsx" }
570+ wx_config {Unicode = " yes" , Version = _OPTIONS [" wx_ver" ], Static = " no" , Debug = " yes" , Libs = wxlibs , Root = " /Users/wangrongwen/cpp/wxtest/wxlib" }
538571
539572 filter { " configurations:Release" , " platforms:Win32" }
540573 wx_config {Unicode = " yes" , Version = _OPTIONS [" wx_ver" ], Static = " yes" , Debug = " no" , WindowsCompiler = wx_compiler , Libs = wxlibs }
541574 filter { " configurations:Release" , " platforms:Win64" }
542575 wx_config {Unicode = " yes" , Version = _OPTIONS [" wx_ver" ], Static = " yes" , Debug = " no" , Arch = " Win64" , WindowsCompiler = wx_compiler , Libs = wxlibs }
576+ filter { " configurations:Release" , " platforms:MacOsx" }
577+ wx_config {Unicode = " yes" , Version = _OPTIONS [" wx_ver" ], Static = " yes" , Debug = " no" , Libs = wxlibs , Root = " /Users/wangrongwen/cpp/wxtest/wxlib" }
543578
544579 filter { " configurations:Release wxDLL" , " platforms:Win32" }
545580 wx_config {Unicode = " yes" , Version = _OPTIONS [" wx_ver" ], Static = " no" , Debug = " no" , WindowsCompiler = wx_compiler , Libs = wxlibs }
546581 filter { " configurations:Release wxDLL" , " platforms:Win64" }
547582 wx_config {Unicode = " yes" , Version = _OPTIONS [" wx_ver" ], Static = " no" , Debug = " no" , Arch = " Win64" , WindowsCompiler = wx_compiler , Libs = wxlibs }
583+ filter { " configurations:Release wxDLL" , " platforms:MacOsx" }
584+ wx_config {Unicode = " yes" , Version = _OPTIONS [" wx_ver" ], Static = " no" , Debug = " no" , Libs = wxlibs , Root = " ../wxlib" }
548585
549586 filter { " configurations:Release DLL" , " platforms:Win32" }
550587 wx_config {Unicode = " yes" , Version = _OPTIONS [" wx_ver" ], Static = " no" , Debug = " no" , WindowsCompiler = wx_compiler , Libs = wxlibs }
551588 filter { " configurations:Release DLL" , " platforms:Win64" }
552589 wx_config {Unicode = " yes" , Version = _OPTIONS [" wx_ver" ], Static = " no" , Debug = " no" , Arch = " Win64" , WindowsCompiler = wx_compiler , Libs = wxlibs }
590+ filter { " configurations:Release DLL" , " platforms:MacOsx" }
591+ wx_config {Unicode = " yes" , Version = _OPTIONS [" wx_ver" ], Static = " no" , Debug = " no" , Libs = wxlibs , Root = " ../wxlib" }
553592
554593 filter {}
555594end
@@ -597,41 +636,59 @@ function use_filters(libname, debugcwd, wxlibs)
597636 filter { " configurations:Debug" , " platforms:Win64" }
598637 wx_config {Unicode = " yes" , Version = _OPTIONS [" wx_ver" ], Static = " yes" , Debug = " yes" , Arch = " Win64" , WindowsCompiler = wx_compiler , Libs = wxlibs }
599638 wxSetTargetDirectory (" Win64" , " Debug" )
639+ filter { " configurations:Debug" , " platforms:MacOsx" }
640+ wx_config {Unicode = " yes" , Version = _OPTIONS [" wx_ver" ], Static = " yes" , Debug = " yes" , Libs = wxlibs , Root = " /Users/wangrongwen/cpp/wxtest/wxlib" }
641+ wxSetTargetDirectory (" MacOsx" , " Debug" )
600642
601643 filter { " configurations:Debug wxDLL" , " platforms:Win32" }
602644 wx_config {Unicode = " yes" , Version = _OPTIONS [" wx_ver" ], Static = " no" , Debug = " yes" , WindowsCompiler = wx_compiler , Libs = wxlibs }
603645 wxSetTargetDirectory (" Win32" , " Debug wxDLL" )
604646 filter { " configurations:Debug wxDLL" , " platforms:Win64" }
605647 wx_config {Unicode = " yes" , Version = _OPTIONS [" wx_ver" ], Static = " no" , Debug = " yes" , Arch = " Win64" , WindowsCompiler = wx_compiler , Libs = wxlibs }
606648 wxSetTargetDirectory (" Win64" , " Debug wxDLL" )
649+ filter { " configurations:Debug wxDLL" , " platforms:MacOsx" }
650+ wx_config {Unicode = " yes" , Version = _OPTIONS [" wx_ver" ], Static = " no" , Debug = " yes" , Libs = wxlibs , Root = " /Users/wangrongwen/cpp/wxtest/wxlib" }
651+ wxSetTargetDirectory (" MacOsx" , " Debug wxDLL" )
607652
608653 filter { " configurations:Debug DLL" , " platforms:Win32" }
609654 wx_config {Unicode = " yes" , Version = _OPTIONS [" wx_ver" ], Static = " no" , Debug = " yes" , WindowsCompiler = wx_compiler , Libs = wxlibs }
610655 wxSetTargetDirectory (" Win32" , " Debug DLL" )
611656 filter { " configurations:Debug DLL" , " platforms:Win64" }
612657 wx_config {Unicode = " yes" , Version = _OPTIONS [" wx_ver" ], Static = " no" , Debug = " yes" , Arch = " Win64" , WindowsCompiler = wx_compiler , Libs = wxlibs }
613658 wxSetTargetDirectory (" Win64" , " Debug DLL" )
659+ filter { " configurations:Debug DLL" , " platforms:MacOsx" }
660+ wx_config {Unicode = " yes" , Version = _OPTIONS [" wx_ver" ], Static = " no" , Debug = " yes" , Libs = wxlibs , Root = " /Users/wangrongwen/cpp/wxtest/wxlib" }
661+ wxSetTargetDirectory (" MacOsx" , " Debug DLL" )
614662
615663 filter { " configurations:Release" , " platforms:Win32" }
616664 wx_config {Unicode = " yes" , Version = _OPTIONS [" wx_ver" ], Static = " yes" , Debug = " no" , WindowsCompiler = wx_compiler , Libs = wxlibs }
617665 wxSetTargetDirectory (" Win32" , " Release" )
618666 filter { " configurations:Release" , " platforms:Win64" }
619667 wx_config {Unicode = " yes" , Version = _OPTIONS [" wx_ver" ], Static = " yes" , Debug = " no" , Arch = " Win64" , WindowsCompiler = wx_compiler , Libs = wxlibs }
620668 wxSetTargetDirectory (" Win64" , " Release" )
669+ filter { " configurations:Release" , " platforms:MacOsx" }
670+ wx_config {Unicode = " yes" , Version = _OPTIONS [" wx_ver" ], Static = " yes" , Debug = " no" , Libs = wxlibs , Root = " /Users/wangrongwen/cpp/wxtest/wxlib" }
671+ wxSetTargetDirectory (" MacOsx" , " Release" )
621672
622673 filter { " configurations:Release wxDLL" , " platforms:Win32" }
623674 wx_config {Unicode = " yes" , Version = _OPTIONS [" wx_ver" ], Static = " no" , Debug = " no" , WindowsCompiler = wx_compiler , Libs = wxlibs }
624675 wxSetTargetDirectory (" Win32" , " Release wxDLL" )
625676 filter { " configurations:Release wxDLL" , " platforms:Win64" }
626677 wx_config {Unicode = " yes" , Version = _OPTIONS [" wx_ver" ], Static = " no" , Debug = " no" , Arch = " Win64" , WindowsCompiler = wx_compiler , Libs = wxlibs }
627678 wxSetTargetDirectory (" Win64" , " Release wxDLL" )
679+ filter { " configurations:Release wxDLL" , " platforms:MacOsx" }
680+ wx_config {Unicode = " yes" , Version = _OPTIONS [" wx_ver" ], Static = " no" , Debug = " no" , Libs = wxlibs , Root = " ../wxlib" }
681+ wxSetTargetDirectory (" MacOsx" , " Release wxDLL" )
628682
629683 filter { " configurations:Release DLL" , " platforms:Win32" }
630684 wx_config {Unicode = " yes" , Version = _OPTIONS [" wx_ver" ], Static = " no" , Debug = " no" , WindowsCompiler = wx_compiler , Libs = wxlibs }
631685 wxSetTargetDirectory (" Win32" , " Release DLL" )
632686 filter { " configurations:Release DLL" , " platforms:Win64" }
633687 wx_config {Unicode = " yes" , Version = _OPTIONS [" wx_ver" ], Static = " no" , Debug = " no" , Arch = " Win64" , WindowsCompiler = wx_compiler , Libs = wxlibs }
634688 wxSetTargetDirectory (" Win64" , " Release DLL" )
689+ filter { " configurations:Release DLL" , " platforms:MacOsx" }
690+ wx_config {Unicode = " yes" , Version = _OPTIONS [" wx_ver" ], Static = " no" , Debug = " no" , Libs = wxlibs , Root = " ../wxlib" }
691+ wxSetTargetDirectory (" MacOsx" , " Release DLL" )
635692
636693 filter {}
637694end
0 commit comments