Compare commits
10 Commits
e9578bcffd
...
50f3324c10
| Author | SHA1 | Date | |
|---|---|---|---|
| 50f3324c10 | |||
|
|
2a698faef3 | ||
|
|
aaeed080fb | ||
|
|
ac40694691 | ||
|
|
5ea557e0a3 | ||
|
|
cb054f92b8 | ||
|
|
149c9d737e | ||
|
|
8073fed85e | ||
|
|
5d27a6cb4b | ||
|
|
4d50c3db49 |
7
Makefile
7
Makefile
@@ -1,10 +1,13 @@
|
|||||||
# Make recurse into 'src' directory
|
# Make recurse into 'src' directory
|
||||||
.PHONY: default clean
|
.PHONY: default clean manual
|
||||||
|
|
||||||
default:
|
default:
|
||||||
cd src; ./build.sh
|
cd src; ./build.sh
|
||||||
|
|
||||||
|
manual:
|
||||||
|
cd manual; make
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
cd src; make clean; cd ..
|
cd src; make clean
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -152,6 +152,12 @@ class EditorStc(Editor):
|
|||||||
self.errorstyle = 5
|
self.errorstyle = 5
|
||||||
self.control.StyleSetSpec(self.errorstyle, "fore:#FFFF0000,back:#FF0000")
|
self.control.StyleSetSpec(self.errorstyle, "fore:#FFFF0000,back:#FF0000")
|
||||||
|
|
||||||
|
try:
|
||||||
|
if wx.SystemSettings.GetAppearance().IsDark():
|
||||||
|
self.control.StyleSetSpec(STC_STYLE_LINENUMBER, "fore:#FFFFFF")
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
def GetText(self):
|
def GetText(self):
|
||||||
return self.control.GetText()
|
return self.control.GetText()
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,10 @@
|
|||||||
import wx
|
import wx
|
||||||
import os.path
|
import os.path
|
||||||
|
|
||||||
|
from time import sleep
|
||||||
|
|
||||||
|
import threading
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
""" Import scyther-gui components """
|
""" Import scyther-gui components """
|
||||||
@@ -42,6 +46,8 @@ ID_VERIFY = 100
|
|||||||
ID_AUTOVERIFY = 101
|
ID_AUTOVERIFY = 101
|
||||||
ID_CHARACTERIZE = 102
|
ID_CHARACTERIZE = 102
|
||||||
ID_CHECK = 103
|
ID_CHECK = 103
|
||||||
|
ID_WATCH = 104
|
||||||
|
ID_STOP_WATCH = 105
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
@@ -63,6 +69,9 @@ class MainWindow(wx.Frame):
|
|||||||
self.filename = ''
|
self.filename = ''
|
||||||
self.filepath = ""
|
self.filepath = ""
|
||||||
|
|
||||||
|
self.watchfile = None
|
||||||
|
self.watchThread = None
|
||||||
|
|
||||||
self.load = False
|
self.load = False
|
||||||
|
|
||||||
# test
|
# test
|
||||||
@@ -162,6 +171,8 @@ class MainWindow(wx.Frame):
|
|||||||
(wx.ID_NEW, '&New\tCTRL-N', 'Create a new file', self.OnNew),
|
(wx.ID_NEW, '&New\tCTRL-N', 'Create a new file', self.OnNew),
|
||||||
(wx.ID_OPEN, '&Open\tCTRL-O', 'Open a new file', self.OnOpen),
|
(wx.ID_OPEN, '&Open\tCTRL-O', 'Open a new file', self.OnOpen),
|
||||||
(wx.ID_SAVE, '&Save\tCTRL-S', 'Save the current file', self.OnSave),
|
(wx.ID_SAVE, '&Save\tCTRL-S', 'Save the current file', self.OnSave),
|
||||||
|
(ID_WATCH, 'Watch', 'Whatch a file for changes', self.OnWatch),
|
||||||
|
(ID_STOP_WATCH, 'Stop Watch', 'Stop watching for changes', self.OnStopWatch),
|
||||||
(wx.ID_SAVEAS, 'Save &As', 'Save the file under a different name',
|
(wx.ID_SAVEAS, 'Save &As', 'Save the file under a different name',
|
||||||
self.OnSaveAs),
|
self.OnSaveAs),
|
||||||
(None, None, None, None),
|
(None, None, None, None),
|
||||||
@@ -188,7 +199,10 @@ class MainWindow(wx.Frame):
|
|||||||
def SetTitle(self):
|
def SetTitle(self):
|
||||||
# MainWindow.SetTitle overrides wx.Frame.SetTitle, so we have to
|
# MainWindow.SetTitle overrides wx.Frame.SetTitle, so we have to
|
||||||
# call it using super:
|
# call it using super:
|
||||||
|
if self.filename:
|
||||||
super(MainWindow, self).SetTitle('Scyther: %s'%self.filename)
|
super(MainWindow, self).SetTitle('Scyther: %s'%self.filename)
|
||||||
|
else:
|
||||||
|
super(MainWindow, self).SetTitle('Scyther: Unsaved File...')
|
||||||
|
|
||||||
# Helper methods:
|
# Helper methods:
|
||||||
|
|
||||||
@@ -214,8 +228,7 @@ class MainWindow(wx.Frame):
|
|||||||
return userProvidedFilename
|
return userProvidedFilename
|
||||||
|
|
||||||
# Are we dropping a changed file?
|
# Are we dropping a changed file?
|
||||||
|
def ConfirmLoss(self):
|
||||||
def ConfirmLoss(self,text=None):
|
|
||||||
"""
|
"""
|
||||||
Try to drop the current file. If it was changed, try to save
|
Try to drop the current file. If it was changed, try to save
|
||||||
(as)
|
(as)
|
||||||
@@ -226,9 +239,11 @@ class MainWindow(wx.Frame):
|
|||||||
if self.editor.GetChanged():
|
if self.editor.GetChanged():
|
||||||
# File changed, we need to confirm this
|
# File changed, we need to confirm this
|
||||||
title = "Unsaved changes"
|
title = "Unsaved changes"
|
||||||
if text:
|
if self.filename:
|
||||||
title = "%s - " + title
|
title = ("%s - " + title) % (self.filename)
|
||||||
txt = "The protocol file '%s' has been modified.\n\n" % (self.filename)
|
txt = "The protocol file '%s' has been modified.\n\n" % (self.filename)
|
||||||
|
else:
|
||||||
|
txt = "You have unsaved changes.\n\n"
|
||||||
txt = txt + "Do you want to"
|
txt = txt + "Do you want to"
|
||||||
txt = txt + " save your changes (Yes)"
|
txt = txt + " save your changes (Yes)"
|
||||||
txt = txt + " or"
|
txt = txt + " or"
|
||||||
@@ -263,19 +278,74 @@ class MainWindow(wx.Frame):
|
|||||||
dlg.Destroy()
|
dlg.Destroy()
|
||||||
|
|
||||||
def OnExit(self, event):
|
def OnExit(self, event):
|
||||||
if self.ConfirmLoss("Exit"):
|
if self.ConfirmLoss():
|
||||||
self.Close() # Close the main window.
|
self.Close() # Close the main window.
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def OnNew(self, event):
|
def OnNew(self, event):
|
||||||
if self.ConfirmLoss("Open"):
|
if self.ConfirmLoss():
|
||||||
self.editor.SetText('')
|
self.editor.SetText('')
|
||||||
self.filename = ''
|
self.filename = ''
|
||||||
self.editor.SetOpened()
|
self.editor.SetOpened()
|
||||||
|
self.SetTitle()
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
def OnWatch(self, event):
|
||||||
|
if self.watchfile != None or self.watchThread != None:
|
||||||
|
self.watchfile = None
|
||||||
|
self.watchThread.join()
|
||||||
|
self.watchThread = None
|
||||||
|
|
||||||
|
if self.ConfirmLoss():
|
||||||
|
if self.askUserForFilename(style=wx.FD_OPEN, **self.defaultFileDialogOptions()):
|
||||||
|
|
||||||
|
self.editor.SetText("")
|
||||||
|
self.editor.SetOpened()
|
||||||
|
|
||||||
|
self.editor.control.Enable(False)
|
||||||
|
|
||||||
|
name = str(self.filename)
|
||||||
|
|
||||||
|
self.watchfile = name
|
||||||
|
|
||||||
|
def runMain():
|
||||||
|
while name == self.watchfile:
|
||||||
|
textfile = open(os.path.join(self.dirname, self.filename), 'r')
|
||||||
|
|
||||||
|
data = textfile.read()
|
||||||
|
|
||||||
|
if data != self.editor.GetText():
|
||||||
|
self.editor.SetText(data)
|
||||||
|
textfile.close()
|
||||||
|
self.editor.SetOpened()
|
||||||
|
|
||||||
|
# Clear errors before verification
|
||||||
|
self.editor.SetErrors(None)
|
||||||
|
# Verify spdl
|
||||||
|
s = Scytherthread.ScytherRun(self,"verify",data,self.editor.SetErrors, watchMode=True, watchModeFile=self.filename)
|
||||||
|
|
||||||
|
sleep(0.9)
|
||||||
|
|
||||||
|
self.watchThread = threading.Thread(target=runMain)
|
||||||
|
|
||||||
|
self.watchThread.start()
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
|
return False
|
||||||
|
|
||||||
|
def OnStopWatch(self, event):
|
||||||
|
self.watchfile = None
|
||||||
|
thread = self.watchThread
|
||||||
|
self.watchThread = None
|
||||||
|
thread.join()
|
||||||
|
self.editor.control.Enable(True)
|
||||||
|
self.editor.SetText("")
|
||||||
|
self.editor.SetOpened()
|
||||||
|
return True
|
||||||
|
|
||||||
def OnSave(self, event):
|
def OnSave(self, event):
|
||||||
if self.filename=='':
|
if self.filename=='':
|
||||||
return self.OnSaveAs(event)
|
return self.OnSaveAs(event)
|
||||||
@@ -287,7 +357,7 @@ class MainWindow(wx.Frame):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
def OnOpen(self, event):
|
def OnOpen(self, event):
|
||||||
if self.ConfirmLoss("Open"):
|
if self.ConfirmLoss():
|
||||||
if self.askUserForFilename(style=wx.FD_OPEN,
|
if self.askUserForFilename(style=wx.FD_OPEN,
|
||||||
**self.defaultFileDialogOptions()):
|
**self.defaultFileDialogOptions()):
|
||||||
textfile = open(os.path.join(self.dirname, self.filename), 'r')
|
textfile = open(os.path.join(self.dirname, self.filename), 'r')
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
""" Import externals """
|
""" Import externals """
|
||||||
import wx
|
import wx
|
||||||
import threading
|
import threading
|
||||||
|
import subprocess
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
@@ -39,6 +40,8 @@ from . import Icon
|
|||||||
from . import Error
|
from . import Error
|
||||||
from . import Makeimage
|
from . import Makeimage
|
||||||
|
|
||||||
|
from .Misc import dotOutputWrite
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
if Preference.havePIL:
|
if Preference.havePIL:
|
||||||
import Image
|
import Image
|
||||||
@@ -254,7 +257,7 @@ class ResultWindow(wx.Frame):
|
|||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self, parent, parentwindow, title, pos=wx.DefaultPosition, size=wx.DefaultSize,
|
self, parent, parentwindow, title, pos=wx.DefaultPosition, size=wx.DefaultSize,
|
||||||
style=wx.DEFAULT_DIALOG_STYLE
|
style=wx.DEFAULT_DIALOG_STYLE, watchMode = False, watchModeFile = None
|
||||||
):
|
):
|
||||||
|
|
||||||
wx.Frame.__init__(self,parentwindow,-1,title,pos,size,style)
|
wx.Frame.__init__(self,parentwindow,-1,title,pos,size,style)
|
||||||
@@ -263,6 +266,8 @@ class ResultWindow(wx.Frame):
|
|||||||
|
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
self.thread = None
|
self.thread = None
|
||||||
|
self.watchMode = watchMode
|
||||||
|
self.watchModeFile = watchModeFile
|
||||||
aTable = wx.AcceleratorTable([
|
aTable = wx.AcceleratorTable([
|
||||||
(wx.ACCEL_CTRL, ord('W'), wx.ID_CLOSE),
|
(wx.ACCEL_CTRL, ord('W'), wx.ID_CLOSE),
|
||||||
(wx.ACCEL_NORMAL, wx.WXK_ESCAPE, wx.ID_CLOSE),
|
(wx.ACCEL_NORMAL, wx.WXK_ESCAPE, wx.ID_CLOSE),
|
||||||
@@ -277,6 +282,12 @@ class ResultWindow(wx.Frame):
|
|||||||
|
|
||||||
def onViewButton(self,evt):
|
def onViewButton(self,evt):
|
||||||
btn = evt.GetEventObject()
|
btn = evt.GetEventObject()
|
||||||
|
|
||||||
|
if self.watchMode:
|
||||||
|
print("Watching generating image")
|
||||||
|
dotOutputWrite(btn.claim.attacks[0].scytherDot, self.watchModeFile + ".png",["-Tpng"])
|
||||||
|
subprocess.run(['xdg-open', self.watchModeFile + ".png"])
|
||||||
|
else:
|
||||||
try:
|
try:
|
||||||
w = Attackwindow.AttackWindow(btn.claim)
|
w = Attackwindow.AttackWindow(btn.claim)
|
||||||
w.Show(True)
|
w.Show(True)
|
||||||
@@ -423,8 +434,10 @@ class ResultWindow(wx.Frame):
|
|||||||
|
|
||||||
class ScytherRun(object):
|
class ScytherRun(object):
|
||||||
|
|
||||||
def __init__(self,mainwin,mode,spdl,errorcallback=None):
|
def __init__(self,mainwin,mode,spdl,errorcallback=None, watchMode=False, watchModeFile = None):
|
||||||
|
|
||||||
|
self.watchMode = watchMode
|
||||||
|
self.watchModeFile = watchModeFile
|
||||||
self.mainwin = mainwin
|
self.mainwin = mainwin
|
||||||
self.mode = mode
|
self.mode = mode
|
||||||
self.spdl = spdl
|
self.spdl = spdl
|
||||||
@@ -505,7 +518,7 @@ class ScytherRun(object):
|
|||||||
|
|
||||||
# Great, we verified stuff, progress to the claim report
|
# Great, we verified stuff, progress to the claim report
|
||||||
title = "Scyther results : %s" % self.mode
|
title = "Scyther results : %s" % self.mode
|
||||||
self.resultwin = resultwin = ResultWindow(self,self.mainwin,title)
|
self.resultwin = resultwin = ResultWindow(self,self.mainwin,title, watchMode=self.watchMode, watchModeFile=self.watchModeFile)
|
||||||
|
|
||||||
def attackDone(attack,total,done):
|
def attackDone(attack,total,done):
|
||||||
if resultwin:
|
if resultwin:
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ import os.path
|
|||||||
import sys
|
import sys
|
||||||
import io
|
import io
|
||||||
import tempfile
|
import tempfile
|
||||||
|
import platform
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import hashlib
|
import hashlib
|
||||||
HASHLIB = True
|
HASHLIB = True
|
||||||
@@ -170,6 +172,14 @@ def getScytherBackend():
|
|||||||
elif "darwin" in sys.platform:
|
elif "darwin" in sys.platform:
|
||||||
|
|
||||||
""" OS X """
|
""" OS X """
|
||||||
|
# Check if there is an ARM version available at scyther-mac-arm
|
||||||
|
# Otherwise, just fallback to the default scyther-mac which is the
|
||||||
|
# Intel version for backwards-compatibility reasons.
|
||||||
|
has_arm_build = os.path.exists(os.path.join(getBinDir(),"scyther-mac-arm"))
|
||||||
|
|
||||||
|
if platform.processor().startswith("arm") and has_arm_build:
|
||||||
|
scythername = "scyther-mac-arm"
|
||||||
|
else:
|
||||||
scythername = "scyther-mac"
|
scythername = "scyther-mac"
|
||||||
|
|
||||||
elif sys.platform.startswith('win'):
|
elif sys.platform.startswith('win'):
|
||||||
|
|||||||
BIN
gui/nsl3-broken.spdl.png
Normal file
BIN
gui/nsl3-broken.spdl.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 126 KiB |
@@ -157,45 +157,6 @@ def parseArgs():
|
|||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
class MySplashScreen(WXPYTHONINFREQ.SplashScreen):
|
|
||||||
def __init__(self,basedir):
|
|
||||||
path = os.path.join(basedir,"Images")
|
|
||||||
image = os.path.join(path,"scyther-splash.png")
|
|
||||||
bmp = wx.Image(image).ConvertToBitmap()
|
|
||||||
wx.SplashScreen.__init__(self, bmp,
|
|
||||||
wx.SPLASH_CENTRE_ON_SCREEN | wx.SPLASH_TIMEOUT,
|
|
||||||
5000, None, -1)
|
|
||||||
self.Bind(wx.EVT_CLOSE, self.OnClose)
|
|
||||||
self.fc = wx.FutureCall(2000, self.ShowMain)
|
|
||||||
|
|
||||||
def OnClose(self, evt):
|
|
||||||
# Make sure the default handler runs too so this window gets
|
|
||||||
# destroyed
|
|
||||||
evt.Skip()
|
|
||||||
self.Hide()
|
|
||||||
|
|
||||||
# if the timer is still running then go ahead and show the
|
|
||||||
# main frame now
|
|
||||||
if self.fc.IsRunning():
|
|
||||||
self.fc.Stop()
|
|
||||||
self.ShowMain()
|
|
||||||
|
|
||||||
|
|
||||||
def ShowMain(self):
|
|
||||||
if self.fc.IsRunning():
|
|
||||||
self.Raise()
|
|
||||||
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
def isSplashNeeded(opts):
|
|
||||||
if not opts.command:
|
|
||||||
if opts.splashscreen and not (Preference.get('splashscreen') in ['false','off','disable','0']):
|
|
||||||
return True
|
|
||||||
return False
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class ScytherApp(wx.App):
|
class ScytherApp(wx.App):
|
||||||
def OnInit(self):
|
def OnInit(self):
|
||||||
import os, inspect
|
import os, inspect
|
||||||
@@ -232,11 +193,6 @@ class ScytherApp(wx.App):
|
|||||||
self.SetTopWindow(self.mainWindow)
|
self.SetTopWindow(self.mainWindow)
|
||||||
self.mainWindow.Show()
|
self.mainWindow.Show()
|
||||||
|
|
||||||
if isSplashNeeded(opts):
|
|
||||||
dlg = About.AboutScyther(self.mainWindow,basedir)
|
|
||||||
dlg.ShowModal()
|
|
||||||
dlg.Destroy()
|
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
#def OnExit(self):
|
#def OnExit(self):
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
### Build process
|
### Build process
|
||||||
|
|
||||||
- Ensure manual build is triggered from root directory Makefile, ideally after checking for the dependencies.
|
- Ensure manual build is triggered from root directory Makefile, ideally after checking for the dependencies. (Partially done: `make manual` from root dir works now.)
|
||||||
|
|
||||||
### To document
|
### To document
|
||||||
|
|
||||||
|
|||||||
11
src/BuildMacArm-MacIntel.cmake
Normal file
11
src/BuildMacArm-MacIntel.cmake
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
################################################################
|
||||||
|
# Name: BuildMacIntel.cmake
|
||||||
|
# Purpose: Build MacIntel binary
|
||||||
|
# Author: Cas Cremers
|
||||||
|
################################################################
|
||||||
|
|
||||||
|
message (STATUS "Building Apple Mac Intel version (cross-compiling)")
|
||||||
|
set (scythername "scyther-mac")
|
||||||
|
add_executable (${scythername} ${Scyther_sources})
|
||||||
|
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mmacosx-version-min=10.6 -arch x86_64")
|
||||||
|
set (CMAKE_OSX_ARCHITECTURES "x86_64")
|
||||||
10
src/BuildMacArm.cmake
Normal file
10
src/BuildMacArm.cmake
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
################################################################
|
||||||
|
# Name: BuildMacArm.cmake
|
||||||
|
# Purpose: Build MacArm binary
|
||||||
|
# Author: Sam Jakob M.
|
||||||
|
################################################################
|
||||||
|
|
||||||
|
message (STATUS "Building Apple Mac ARM (Apple Silicon) version")
|
||||||
|
set (scythername "scyther-mac")
|
||||||
|
add_executable (${scythername} ${Scyther_sources})
|
||||||
|
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mmacosx-version-min=10.15")
|
||||||
@@ -7,5 +7,5 @@
|
|||||||
message (STATUS "Building Apple Mac Intel version")
|
message (STATUS "Building Apple Mac Intel version")
|
||||||
set (scythername "scyther-mac")
|
set (scythername "scyther-mac")
|
||||||
add_executable (${scythername} ${Scyther_sources})
|
add_executable (${scythername} ${Scyther_sources})
|
||||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mmacosx-version-min=10.6")
|
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mmacosx-version-min=10.6 -arch x86_64")
|
||||||
|
set (CMAKE_OSX_ARCHITECTURES "x86_64")
|
||||||
|
|||||||
@@ -6,8 +6,7 @@
|
|||||||
|
|
||||||
# Scyther project
|
# Scyther project
|
||||||
project (Scyther)
|
project (Scyther)
|
||||||
# I need 2.4 for flex/etc although it does not run yet
|
CMAKE_MINIMUM_REQUIRED(VERSION 2.18)
|
||||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
|
|
||||||
|
|
||||||
# Try clang
|
# Try clang
|
||||||
#set (CMAKE_C_COMPILER "clang")
|
#set (CMAKE_C_COMPILER "clang")
|
||||||
|
|||||||
@@ -18,9 +18,13 @@ if (WIN32)
|
|||||||
else (WIN32)
|
else (WIN32)
|
||||||
# Not windows, is it a mac?
|
# Not windows, is it a mac?
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
# TODO: A mac, but what architecture?
|
if(${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "arm64" AND NOT DEFINED ENV{ARCH})
|
||||||
# For now we assume intel
|
# If Apple and Arm64, set Source_OS to MacArm
|
||||||
set (Source_OS "MacIntel")
|
set(Source_OS "MacArm")
|
||||||
|
else(${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "arm64" AND NOT DEFINED ENV{ARCH})
|
||||||
|
# If not arm64, assume Intel for legacy reasons.
|
||||||
|
set(Source_OS "MacIntel")
|
||||||
|
endif(${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "arm64" AND NOT DEFINED ENV{ARCH})
|
||||||
else (APPLE)
|
else (APPLE)
|
||||||
# Not a mac, not windows
|
# Not a mac, not windows
|
||||||
if (UNIX)
|
if (UNIX)
|
||||||
|
|||||||
16
src/build.sh
16
src/build.sh
@@ -5,13 +5,19 @@
|
|||||||
|
|
||||||
# Different choice if on Darwin
|
# Different choice if on Darwin
|
||||||
PLATFORM=`uname`
|
PLATFORM=`uname`
|
||||||
echo $PLATFORM
|
echo "Platform: $PLATFORM"
|
||||||
if [ "$PLATFORM" = "Darwin" ]
|
|
||||||
then
|
if [ "$PLATFORM" = "Darwin" ]; then
|
||||||
|
ARCH=`arch`
|
||||||
|
echo "Architecture: $ARCH"
|
||||||
|
|
||||||
|
if [ "$ARCH" = "arm64" ]; then
|
||||||
|
./subbuild-mac-arm.sh
|
||||||
|
else
|
||||||
./subbuild-mac-intel.sh
|
./subbuild-mac-intel.sh
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
if [ "$PLATFORM" = "Linux" ]
|
if [ "$PLATFORM" = "Linux" ]; then
|
||||||
then
|
|
||||||
# Build linux version
|
# Build linux version
|
||||||
./subbuild-unix-unix.sh
|
./subbuild-unix-unix.sh
|
||||||
else
|
else
|
||||||
|
|||||||
20
src/subbuild-mac-arm.sh
Executable file
20
src/subbuild-mac-arm.sh
Executable file
@@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Default flags
|
||||||
|
CMFLAGS="-D CMAKE_BUILD_TYPE:STRING=Release"
|
||||||
|
|
||||||
|
# Make for intel
|
||||||
|
cmake $CMFLAGS -D TARGETOS=MacArm . && make scyther-mac
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo
|
||||||
|
echo "---------------------------------------------------------"
|
||||||
|
echo "Built the Mac ARM binary"
|
||||||
|
|
||||||
|
# Copy to the correct locations
|
||||||
|
cp scyther-mac ../gui/Scyther/scyther-mac-arm
|
||||||
|
|
||||||
|
echo Copied the files to their respective locations
|
||||||
|
echo "---------------------------------------------------------"
|
||||||
1
src/version.h
Normal file
1
src/version.h
Normal file
@@ -0,0 +1 @@
|
|||||||
|
#define TAGVERSION "b'v1.2-25-g2a698fa'"
|
||||||
Reference in New Issue
Block a user