Bläddra i källkod

Remove xcodeproj userdata

Don't check out dynamic file for Xcode state.
master
TheoryOfNekomata 1 år sedan
förälder
incheckning
c7248df922
4 ändrade filer med 9 tillägg och 22 borttagningar
  1. +2
    -1
      .gitignore
  2. +2
    -4
      CMakeLists.txt
  3. Binär
      cerberus.xcodeproj/project.xcworkspace/xcuserdata/theoryofnekomata.xcuserdatad/UserInterfaceState.xcuserstate
  4. +5
    -17
      src/main.m

+ 2
- 1
.gitignore Visa fil

@@ -1,3 +1,4 @@
.idea/
cmake-build-debug/
.DS_Store
.DS_Store
*.xcodeproj/project.xcworkspace/xcuserdata/

+ 2
- 4
CMakeLists.txt Visa fil

@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.24)
project(cerberus C)

set(CMAKE_C_STANDARD 11)
project(cerberus C)

if (WIN32)
# TODO set arch on target instead of generator
@@ -17,9 +17,7 @@ elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
# does not work, use Xcode to build
# TODO use makefile instead of cmake?
add_definitions(-DMACOS)
add_executable(cerberus src/main.h src/main.m)
include_directories(/usr/include)
link_directories()
add_executable(cerberus MACOSX_BUNDLE src/main.h src/main.m)
elseif(UNIX)
add_definitions(-DUNIX)
endif ()

Binär
cerberus.xcodeproj/project.xcworkspace/xcuserdata/theoryofnekomata.xcuserdatad/UserInterfaceState.xcuserstate Visa fil


+ 5
- 17
src/main.m Visa fil

@@ -1,26 +1,14 @@
#import <Cocoa/Cocoa.h>
#import "main.h"


int main() {
// https://stackoverflow.com/questions/30269329/creating-window-application-in-pure-c-on-mac-osx
@autoreleasepool {
@autoreleasepool{
[NSApplication sharedApplication];
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
id applicationName = [[NSProcessInfo processInfo] processName];
id window = [
[NSWindow alloc]
initWithContentRect: NSMakeRect(WINDOW_X, WINDOW_Y, WINDOW_WIDTH, WINDOW_HEIGHT)
styleMask:
NSWindowStyleMaskTitled
| NSWindowStyleMaskClosable
| NSWindowStyleMaskMiniaturizable
| NSWindowStyleMaskResizable
backing:NSBackingStoreBuffered
defer:NO
];
[window cascadeTopLeftFromPoint:NSMakePoint(20, 20)];
[window setTitle:applicationName];
id window = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, 120, 120)
styleMask:NSWindowStyleMaskTitled backing:NSBackingStoreBuffered defer:NO];
[window cascadeTopLeftFromPoint:NSMakePoint(20,20)];
[window setTitle: applicationName];
[window makeKeyAndOrderFront:nil];
[NSApp activateIgnoringOtherApps:YES];
[NSApp run];


Laddar…
Avbryt
Spara