Git Product home page Git Product logo

alaingalvan / crosswindow Goto Github PK

View Code? Open in Web Editor NEW
536.0 18.0 47.0 4.44 MB

๐Ÿ’ป๐Ÿ“ฑ A cross platform system abstraction library written in C++ for managing windows and performing OS tasks.

Home Page: https://alain.xyz/libraries/crosswindow

License: MIT License

CMake 6.74% C++ 78.08% C 0.18% Objective-C++ 14.99%
windows macos linux android ios webassembly main cmake xlib xcb mir wayland win32 uwp cocoa uikit emscripten cross-platform

crosswindow's Introduction

Logo

CrossWindow

Cross Window is a cross platform system abstraction library for managing windows and performing OS tasks. It's designed to be easy to integrate, intuitive, and support everything you might need for your apps.

Features

  • ๐ŸŒŸ Simple Window, File Dialog, and Message Dialog Creation.

  • โŒจ๏ธ ๐Ÿ–ฑ๏ธ ๐Ÿ‘† ๐ŸŽฎ Basic Input (Keyboard, Mouse, Touch, and Gamepad).

  • ๐Ÿ‘ป Platform specific features (Mac Transparency, Mobile Accelerometer, etc.).

  • ๐Ÿ’Š Unit Tests + Test Coverage (Appveyor for Windows, CircleCI for Android / MacOS / iOS, [Travis][travis-url] for Linux/Noop).

Supported Platforms

  • ๐Ÿ–ผ๏ธ Windows - Win32

  • ๐ŸŽ Mac - Cocoa

  • ๐Ÿ“ฑ iOS - UIKit

  • ๐Ÿง Linux - XCB or XLib

  • ๐Ÿค– Android (In Progress)

  • ๐ŸŒ WebAssembly - Emscripten

  • โŒ Noop (Headless)

Installation

First add the repo as a submodule in your dependencies folder such as external/:

# โคต๏ธ Add your dependency as a git submodule:
git submodule add https://github.com/alaingalvan/crosswindow.git external/crosswindow

Then in your CMakeLists.txt file, include the following:

# โคต๏ธ Add to your CMake Project:
add_subdirectory(external/crosswindow)

# โŽ When creating your executable use CrossWindow's abstraction function:
xwin_add_executable(
    # Target
    ${PROJECT_NAME}
    # Source Files (make sure to surround in quotations so CMake treats it as a list)
    "${SOURCE_FILES}"
)

# ๐Ÿ”— Link CrossWindow to your project:
target_link_libraries(
    ${PROJECT_NAME}
    CrossWindow
)

Fill out the rest of your CMakeLists.txt file with any other source files and dependencies you may have, then in your project root:

# ๐Ÿ–ผ๏ธ To build your Visual Studio solution on Windows x64
cmake -B build -A x64

# ๐ŸŽ To build your XCode project On Mac OS for Mac OS
cmake -B build -G Xcode

# ๐Ÿ“ฑ To build your XCode project on Mac OS for iOS / iPad OS / tvOS / watchOS
cmake -B build -G Xcode -DCMAKE_SYSTEM_NAME=iOS

# ๐Ÿง To build your .make file on Linux
cmake -B build

# ๐Ÿ”จ Build on any platform:
cmake -B build --build

For WebAssembly you'll need to have Emscripten installed. Assuming you have the SDK installed, do the following to build a WebAssembly project:

# ๐ŸŒ For WebAssembly Projects
mkdir webassembly
cd webassembly
cmake .. -DXWIN_OS=WASM -DCMAKE_TOOLCHAIN_FILE="$EMSDK/emscripten/1.38.1/cmake/Modules/Platform/Emscripten.cmake" -DCMAKE_BUILD_TYPE=Release

# Run emconfigure with the normal configure command as an argument.
$EMSDK/emscripten/emconfigure ./configure

# Run emmake with the normal make to generate linked LLVM bitcode.
$EMSDK/emscripten/emmake make

# Compile the linked bitcode generated by make (project.bc) to JavaScript.
#  'project.bc' should be replaced with the make output for your project (e.g. 'yourproject.so')
$EMSDK/emscripten/emcc project.bc -o project.js

For more information visit the Emscripten Docs on CMake.

For Android Studio you'll need to make a project, then edit your build.gradle file.

// ๐Ÿค– To build your Android Studio project
android {
    ...
    externalNativeBuild {
        cmake {
            ...
            // Use the following syntax when passing arguments to variables:
            // arguments "-DVAR_NAME=ARGUMENT".
            arguments "-DXWIN_OS=ANDROID",
            // The following line passes 'rtti' and 'exceptions' to 'ANDROID_CPP_FEATURES'.
            "-DANDROID_CPP_FEATURES=rtti exceptions"
        }
    }
  buildTypes {...}

  // Use this block to link Gradle to your CMake build script.
  externalNativeBuild {
    cmake {...}
  }
}

for more information visit Android Studio's docs on CMake.

Usage

Then create a main delegate function void xmain(int argc, const char** argv) in a .cpp file in your project (for example "XMain.cpp") where you'll put your application logic:

#include "CrossWindow/CrossWindow.h"

void xmain(int argc, const char** argv)
{
    // ๐Ÿ–ผ๏ธ Create Window Description
    xwin::WindowDesc windowDesc;
    windowDesc.name = "Test";
    windowDesc.title = "My Title";
    windowDesc.visible = true;
    windowDesc.width = 1280;
    windowDesc.height = 720;

    bool closed = false;

    // ๐ŸŒŸ Initialize
    xwin::Window window;
    xwin::EventQueue eventQueue;

    if (!window.create(windowDesc, eventQueue))
    { return; }

    // ๐Ÿ Engine loop
    bool isRunning = true;

    while (isRunning)
    {
        // โ™ป๏ธ Update the event queue
        eventQueue.update();

        // ๐ŸŽˆ Iterate through that queue:
        while (!eventQueue.empty())
        {
            const xwin::Event& event = eventQueue.front();

            if (event.type == xwin::EventType::MouseInput)
            {
                const xwin::MouseInputData mouse = event.data.mouseInput;
            }
            if (event.type == xwin::EventType::Close)
            {
                window.close();
                isRunning = false;
            }

            eventQueue.pop();
        }
    }
}

This xmain function will be called from a platform specific main function that will be included in your main project by CMake. If you ever need to access something from the platform specific main function for whatever reason, you'll find it in xwin::getXWinState().

Development

Be sure to have CMake Installed.

CMake Options Description
XWIN_TESTS Whether or not unit tests are enabled. Defaults to OFF, Can be ON or OFF.
XWIN_API The OS API to use for window generation, defaults to AUTO, can be can be NOOP, WIN32, COCOA, UIKIT, XCB , ANDROID, or WASM.
XWIN_OS Optional - What Operating System to build for, functions as a quicker way of setting target platforms. Defaults to AUTO, can be NOOP, WINDOWS, MACOS, LINUX, ANDROID, IOS, WASM. If your platform supports multiple apis, the final api will be automatically set to CrossWindow defaults ( WIN32 on Windows, XCB on Linux ). If XWIN_API is set this option is ignored.

First install Git, then open any terminal in any folder and type:

# ๐Ÿ‘ Clone the repo
git clone https://github.com/alaingalvan/crosswindow.git --recurse-submodules

# ๐Ÿ’ฟ go inside the folder
cd crosswindow

# ๐Ÿ‘ฏ If you forget to `recurse-submodules` you can always run:
git submodule update --init

From there we'll need to set up our build files. Be sure to have the following installed:

Then type the following in your terminal from the repo folder:

# ๐Ÿ–ผ๏ธ To build your Visual Studio solution on Windows x64
cmake -B build -A x64 -DXWIN_TESTS=ON

# ๐ŸŽ To build your XCode project on Mac OS
cmake -B build -G Xcode -DXWIN_TESTS=ON

# ๐Ÿง To build your .make file on Linux
cmake -B build -DXWIN_TESTS=ON

# ๐Ÿ”จ Build on any platform:
cmake -B build --build

Whenever you add new files to the project, run cmake .. from your solution/project folder /build/, and if you edit the CMakeLists.txt file be sure to delete the generated files and run Cmake again.

License

CrossWindow is licensed as either MIT or Apache-2.0, whichever you would prefer.

crosswindow's People

Contributors

alaingalvan avatar carlosfdez avatar fedotov2d avatar jeromedesfieux avatar mario1159 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

crosswindow's Issues

Doesn't compile with WIN32_LEAN_AND_MEAN

I tend to use WIN32_LEAN_AND_MEAN and include what I need where I need it. Unfortunately this breaks CrossWindow's Win32Main.cpp since shellapi.h isn't included by default when defined. I suspect there's likely some other issues with this define, so I figured I'd repo this issue and disable the define for now.

M1 Macs linker command fails

Undefined symbols for architecture arm64:
"xmain(int, char const**)", referenced from:
-[XWinApplication run] in CocoaMain.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [CGame.app/Contents/MacOS/CGame] Error 1
make[1]: *** [CMakeFiles/CGame.dir/all] Error 2
make: *** [all] Error 2

how to change cursor in macos

This open source library is awesome. I would like to know how the change mouse cursor is. I have tried many methods, but still no effect. Can you help me
eg.
// no effect

  • (void)resetCursorRects
    {
    if (self.cursor) {
    [self addCursorRect:[self bounds] cursor: self.cursor];
    } else {
    [super resetCursorRects];
    }
    }
    // no effect
    -cursorUpdate
    {
    }

Text input

Project looks great and clean. However, how do you handle char input?
WM_UNICHAR etc.

Event class size

sizeof(xwin::Event) gives 1152 bytes. The cause is the size of TouchData and GamepadData. It would be more convenient for both classes to use some pointer to heap allocated data.

How can I use the library with visual studio?

I compiled the library and added the .lib and added the include directory to a build of the example however I got the following errors:

1>WindowsProject3.cpp
1>C:\Users\ASD\Project\cpp\libraries\CrossWindow-master\src\CrossWindow\Common\Window.h(31,25): error C2065: 'Window': undeclared identifier
1>C:\Users\ASD\Project\cpp\libraries\CrossWindow-master\src\CrossWindow\Common\Window.h(31,14): error C2923: 'std::shared_ptr': 'Window' is not a valid template type argument for parameter '_Ty'
1>C:\Users\ASD\Project\cpp\libraries\CrossWindow-master\src\CrossWindow\Common\Window.h(32,23): error C2065: 'Window': undeclared identifier
1>C:\Users\ASD\Project\cpp\libraries\CrossWindow-master\src\CrossWindow\Common\Window.h(32,14): error C2923: 'std::weak_ptr': 'Window' is not a valid template type argument for parameter '_Ty'
1>C:\Users\ASD\source\repos\WindowsProject3\WindowsProject3\WindowsProject3.cpp(6,11): error C2039: 'WindowDesc': is not a member of 'xwin'
1>C:\Users\ASD\Project\cpp\libraries\CrossWindow-master\src\CrossWindow\Common\Window.h(29): message : see declaration of 'xwin'
1>C:\Users\ASD\source\repos\WindowsProject3\WindowsProject3\WindowsProject3.cpp(6,22): error C2065: 'WindowDesc': undeclared identifier
1>C:\Users\ASD\source\repos\WindowsProject3\WindowsProject3\WindowsProject3.cpp(6,22): error C2146: syntax error: missing ';' before identifier 'windowDesc'
1>C:\Users\ASD\source\repos\WindowsProject3\WindowsProject3\WindowsProject3.cpp(6,22): error C2065: 'windowDesc': undeclared identifier
1>C:\Users\ASD\source\repos\WindowsProject3\WindowsProject3\WindowsProject3.cpp(7,5): error C2065: 'windowDesc': undeclared identifier
1>C:\Users\ASD\source\repos\WindowsProject3\WindowsProject3\WindowsProject3.cpp(8,5): error C2065: 'windowDesc': undeclared identifier
1>C:\Users\ASD\source\repos\WindowsProject3\WindowsProject3\WindowsProject3.cpp(9,5): error C2065: 'windowDesc': undeclared identifier
1>C:\Users\ASD\source\repos\WindowsProject3\WindowsProject3\WindowsProject3.cpp(10,5): error C2065: 'windowDesc': undeclared identifier
1>C:\Users\ASD\source\repos\WindowsProject3\WindowsProject3\WindowsProject3.cpp(11,5): error C2065: 'windowDesc': undeclared identifier
1>C:\Users\ASD\source\repos\WindowsProject3\WindowsProject3\WindowsProject3.cpp(16,11): error C2039: 'Window': is not a member of 'xwin'
1>C:\Users\ASD\Project\cpp\libraries\CrossWindow-master\src\CrossWindow\Common\Window.h(29): message : see declaration of 'xwin'
1>C:\Users\ASD\source\repos\WindowsProject3\WindowsProject3\WindowsProject3.cpp(16,18): error C2065: 'Window': undeclared identifier
1>C:\Users\ASD\source\repos\WindowsProject3\WindowsProject3\WindowsProject3.cpp(16,18): error C2146: syntax error: missing ';' before identifier 'window'
1>C:\Users\ASD\source\repos\WindowsProject3\WindowsProject3\WindowsProject3.cpp(16,18): error C2065: 'window': undeclared identifier
1>C:\Users\ASD\source\repos\WindowsProject3\WindowsProject3\WindowsProject3.cpp(17,11): error C2039: 'EventQueue': is not a member of 'xwin'
1>C:\Users\ASD\Project\cpp\libraries\CrossWindow-master\src\CrossWindow\Common\Window.h(29): message : see declaration of 'xwin'
1>C:\Users\ASD\source\repos\WindowsProject3\WindowsProject3\WindowsProject3.cpp(17,22): error C2065: 'EventQueue': undeclared identifier
1>C:\Users\ASD\source\repos\WindowsProject3\WindowsProject3\WindowsProject3.cpp(17,22): error C2146: syntax error: missing ';' before identifier 'eventQueue'
1>C:\Users\ASD\source\repos\WindowsProject3\WindowsProject3\WindowsProject3.cpp(17,22): error C2065: 'eventQueue': undeclared identifier
1>C:\Users\ASD\source\repos\WindowsProject3\WindowsProject3\WindowsProject3.cpp(19,10): error C2065: 'window': undeclared identifier
1>C:\Users\ASD\source\repos\WindowsProject3\WindowsProject3\WindowsProject3.cpp(19,24): error C2065: 'windowDesc': undeclared identifier
1>C:\Users\ASD\source\repos\WindowsProject3\WindowsProject3\WindowsProject3.cpp(19,36): error C2065: 'eventQueue': undeclared identifier
1>C:\Users\ASD\source\repos\WindowsProject3\WindowsProject3\WindowsProject3.cpp(30,9): error C2065: 'eventQueue': undeclared identifier
1>C:\Users\ASD\source\repos\WindowsProject3\WindowsProject3\WindowsProject3.cpp(33,17): error C2065: 'eventQueue': undeclared identifier
1>C:\Users\ASD\source\repos\WindowsProject3\WindowsProject3\WindowsProject3.cpp(35,25): error C2039: 'Event': is not a member of 'xwin'
1>C:\Users\ASD\Project\cpp\libraries\CrossWindow-master\src\CrossWindow\Common\Window.h(29): message : see declaration of 'xwin'
1>C:\Users\ASD\source\repos\WindowsProject3\WindowsProject3\WindowsProject3.cpp(35,30): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Users\ASD\source\repos\WindowsProject3\WindowsProject3\WindowsProject3.cpp(35,30): error C2143: syntax error: missing ';' before '&'
1>C:\Users\ASD\source\repos\WindowsProject3\WindowsProject3\WindowsProject3.cpp(35,32): error C2065: 'event': undeclared identifier
1>C:\Users\ASD\source\repos\WindowsProject3\WindowsProject3\WindowsProject3.cpp(35,40): error C2065: 'eventQueue': undeclared identifier
1>C:\Users\ASD\source\repos\WindowsProject3\WindowsProject3\WindowsProject3.cpp(37,17): error C2065: 'event': undeclared identifier
1>C:\Users\ASD\source\repos\WindowsProject3\WindowsProject3\WindowsProject3.cpp(37,37): error C3083: 'EventType': the symbol to the left of a '::' must be a type
1>C:\Users\ASD\source\repos\WindowsProject3\WindowsProject3\WindowsProject3.cpp(37,48): error C2039: 'Mouse': is not a member of 'xwin'
1>C:\Users\ASD\Project\cpp\libraries\CrossWindow-master\src\CrossWindow\Common\Window.h(29): message : see declaration of 'xwin'
1>C:\Users\ASD\source\repos\WindowsProject3\WindowsProject3\WindowsProject3.cpp(37,53): error C2065: 'Mouse': undeclared identifier
1>C:\Users\ASD\source\repos\WindowsProject3\WindowsProject3\WindowsProject3.cpp(39,29): error C2039: 'MouseData': is not a member of 'xwin'
1>C:\Users\ASD\Project\cpp\libraries\CrossWindow-master\src\CrossWindow\Common\Window.h(29): message : see declaration of 'xwin'
1>C:\Users\ASD\source\repos\WindowsProject3\WindowsProject3\WindowsProject3.cpp(39,39): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Users\ASD\source\repos\WindowsProject3\WindowsProject3\WindowsProject3.cpp(39,39): error C2146: syntax error: missing ';' before identifier 'mouse'
1>C:\Users\ASD\source\repos\WindowsProject3\WindowsProject3\WindowsProject3.cpp(39,39): error C2065: 'mouse': undeclared identifier
1>C:\Users\ASD\source\repos\WindowsProject3\WindowsProject3\WindowsProject3.cpp(39,47): error C2065: 'event': undeclared identifier
1>C:\Users\ASD\source\repos\WindowsProject3\WindowsProject3\WindowsProject3.cpp(41,17): error C2065: 'event': undeclared identifier
1>C:\Users\ASD\source\repos\WindowsProject3\WindowsProject3\WindowsProject3.cpp(41,37): error C3083: 'EventType': the symbol to the left of a '::' must be a type
1>C:\Users\ASD\source\repos\WindowsProject3\WindowsProject3\WindowsProject3.cpp(41,48): error C2039: 'Close': is not a member of 'xwin'
1>C:\Users\ASD\Project\cpp\libraries\CrossWindow-master\src\CrossWindow\Common\Window.h(29): message : see declaration of 'xwin'
1>C:\Users\ASD\source\repos\WindowsProject3\WindowsProject3\WindowsProject3.cpp(41,53): error C2065: 'Close': undeclared identifier
1>C:\Users\ASD\source\repos\WindowsProject3\WindowsProject3\WindowsProject3.cpp(43,17): error C2065: 'window': undeclared identifier
1>C:\Users\ASD\source\repos\WindowsProject3\WindowsProject3\WindowsProject3.cpp(47,13): error C2065: 'eventQueue': undeclared identifier
1>Done building project "WindowsProject3.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========```

Unable to access CAMetalLayer with CocoaWindow due to protected layer property

According to the documentation for CrossWindow-Renderer, in order to access the underlying CAMetalLayer, we need to access the layer property. However, this property is marked as protected in CocoaWindow, which makes it impossible to use Metal with Cocoa. The relevant code can be found here:

protected:
// NSString*
void* mTitle;
WindowDesc mDesc;
// XWinWindow*
void* window;
// XWinView*
void* view;
// Any Layer Type
void* layer;

In contrast, the layer property is publicly accessible in UIKitWindow.

Gamepad is not detected (Xbox controller)

 if (event.type == xwin::EventType::Gamepad)
 {
    xwin::GamepadData gamepad = event.data.gamepad;
    std::cout << "gamepad event " << std::endl;

    if (gamepad.connected == true)
    {
        std::cout << "gamepad is connected" << std::endl;
    }
 }

Gamepad is not detected, im using xbox controller.

also std::cout << "gamepad event " << std::endl; doesnt print on console

am i doing it wrong?

could someone please help me? :(

1

file :
main.zip

error: 'GetDpiForWindow' was not declared in this scope

I get multiple compiler errors like this using Windows 10 Version 10.0.19043 Build 19043.
Tried both GCC 11.2 and Clang 13.0. Any ideas on what the issue might be?

[build] G:/Dev/RenderingEngine/Vendor/CrossWindow/src/CrossWindow/Win32/Win32Window.cpp: In member function 'bool xwin::Window::create(const xwin::WindowDesc&, xwin::EventQueue&)':
[build] G:/Dev/RenderingEngine/Vendor/CrossWindow/src/CrossWindow/Win32/Win32Window.cpp:113:48: error: 'SetThreadDpiAwarenessContext' was not declared in this scope
[build]   113 |     DPI_AWARENESS_CONTEXT previousDpiContext = SetThreadDpiAwarenessContext(
[build]       |                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
[build] G:/Dev/RenderingEngine/Vendor/CrossWindow/src/CrossWindow/Win32/Win32Window.cpp:144:20: error: 'GetDpiForWindow' was not declared in this scope; did you mean 'GetTopWindow'?
[build]   144 |         int iDpi = GetDpiForWindow(hwnd);
[build]       |                    ^~~~~~~~~~~~~~~
[build]       |                    GetTopWindow
[build] G:/Dev/RenderingEngine/Vendor/CrossWindow/src/CrossWindow/Win32/Win32Window.cpp: In member function 'float xwin::Window::getDpiScale() const':
[build] G:/Dev/RenderingEngine/Vendor/CrossWindow/src/CrossWindow/Win32/Win32Window.cpp:236:22: error: 'GetDpiForWindow' was not declared in this scope; did you mean 'GetTopWindow'?
[build]   236 |     int currentDpi = GetDpiForWindow(hwnd);
[build]       |                      ^~~~~~~~~~~~~~~
[build]       |                      GetTopWindow
[build] [2/4  50% :: 6.310] Building CXX object Vendor/CrossWindow/CMakeFiles/CrossWindow.dir/src/CrossWindow/Win32/Win32EventQueue.cpp.obj
[build] FAILED: Vendor/CrossWindow/CMakeFiles/CrossWindow.dir/src/CrossWindow/Win32/Win32EventQueue.cpp.obj 
[build] D:\Apps\msys2\mingw64\bin\x86_64-w64-mingw32-g++.exe -DXWIN_WIN32=1 -IG:/Dev/RenderingEngine/Vendor/CrossWindow/src -g -std=c++14 -MD -MT Vendor/CrossWindow/CMakeFiles/CrossWindow.dir/src/CrossWindow/Win32/Win32EventQueue.cpp.obj -MF Vendor\CrossWindow\CMakeFiles\CrossWindow.dir\src\CrossWindow\Win32\Win32EventQueue.cpp.obj.d -o Vendor/CrossWindow/CMakeFiles/CrossWindow.dir/src/CrossWindow/Win32/Win32EventQueue.cpp.obj -c G:/Dev/RenderingEngine/Vendor/CrossWindow/src/CrossWindow/Win32/Win32EventQueue.cpp
[build] G:/Dev/RenderingEngine/Vendor/CrossWindow/src/CrossWindow/Win32/Win32EventQueue.cpp: In member function 'LRESULT xwin::EventQueue::pushEvent(MSG, xwin::Window*)':
[build] G:/Dev/RenderingEngine/Vendor/CrossWindow/src/CrossWindow/Win32/Win32EventQueue.cpp:758:28: error: 'GetDpiForWindow' was not declared in this scope; did you mean 'GetTopWindow'?
[build]   758 |                 int iDpi = GetDpiForWindow(window->hwnd);
[build]       |                            ^~~~~~~~~~~~~~~
[build]       |                            GetTopWindow

Resize events are delayed (freezes the 04-cross-platform-hello-triangle for several seconds)

I am testing CrossWindow on Windows 10, mainly the 04-cross-platform-hello-triangle

When I pick one of the corners of the window and move my mouse around for a couple of seconds, and then let go of the mouse button, the CrossWindow freezes up completely and I have to wait a couple seconds more for it to render/respond again.

The problem is very likely caused by how event-queueing is implemented (i.e. class EventQueue) and how it is used by the Window class.
The input events seem to get queued up during the resizing of the window, and CrossWindow only starts actually processing the events (emptying the queue) when the mouse button is released.

This also means that no content is visible in the window while it is being resized, but only white/black artifacts are shown.
(Ideally the resizing would happen in realtime, and content will be shown at all times)

PS:

  • I had to fix several (minor) compile issues before I could get the example running, mainly a hwnd field getting replaced by a getHwnd() function
  • The DIRECTX12 renderer does not render the triangle, there are D3D12 error messages logged for each rendered frame (see below)
  • The DIRECTX11 renderer does work, but it also logs D3D11 error messages (see below)

D3D12 log:

D3D12 MESSAGE: GPU-BASED VALIDATION: TRACE BEGIN: PreDraw [ EXECUTION MESSAGE #1014: BEGIN_EVENT]
D3D12 MESSAGE: GPU-BASED VALIDATION: TRACE END: PreDraw [ EXECUTION MESSAGE #1015: END_EVENT]
D3D12 ERROR: GPU-BASED VALIDATION: DrawInstanced, RenderTarget state invalid, Slot [0], Incompatible resource state: Resource: 0x000002AE7558FB70:'Unnamed ID3D12Resource Object', Subresource Index: [0], Resource State: D3D12_RESOURCE_STATE_[COMMON|PRESENT](0x0), Required State Bits: D3D12_RESOURCE_STATE_RENDER_TARGET(0x4), Draw Count [0], Dispatch Count [0], Command List: 0x000002AE75A5C9C0:'Unnamed ID3D12GraphicsCommandList Object',  [ EXECUTION ERROR #942: GPU_BASED_VALIDATION_INCOMPATIBLE_RESOURCE_STATE]
D3D12 ERROR: GPU-BASED VALIDATION: ResourceBarrier, StateBefore invalid, Barrier array index [0], Incompatible resource state: Resource: 0x000002AE7558FB70:'Unnamed ID3D12Resource Object', Subresource Index: [0], Resource State: D3D12_RESOURCE_STATE_[COMMON|PRESENT](0x0), Required State Bits: D3D12_RESOURCE_STATE_RENDER_TARGET(0x4), Draw Count [0], Dispatch Count [0], Command List: 0x000002AE75A5C9C0:'Unnamed ID3D12GraphicsCommandList Object',  [ EXECUTION ERROR #942: GPU_BASED_VALIDATION_INCOMPATIBLE_RESOURCE_STATE]
D3D12 ERROR: ID3D12CommandList::DrawIndexedInstanced: No pipeline state has been set in this command list.  The runtime will use a default no-op pipeline state. [ EXECUTION ERROR #1045: COMMAND_LIST_PIPELINE_STATE_NOT_SET]
D3D12 ERROR: ID3D12CommandQueue::ExecuteCommandLists: Using Draw on Command List (0x000002AE75A5C9C0:'Unnamed ID3D12GraphicsCommandList Object'): Resource state (0x0: D3D12_RESOURCE_STATE_[COMMON|PRESENT]) of resource (0x000002AE75590920:'Unnamed ID3D12Resource Object') (subresource: 0) is invalid for use as a render target.  Expected State Bits (all): 0x4: D3D12_RESOURCE_STATE_RENDER_TARGET, Actual State: 0x0: D3D12_RESOURCE_STATE_[COMMON|PRESENT], Missing State: 0x4: D3D12_RESOURCE_STATE_RENDER_TARGET. [ EXECUTION ERROR #538: INVALID_SUBRESOURCE_STATE]
D3D12 ERROR: ID3D12CommandQueue::ExecuteCommandLists: Using ResourceBarrier on Command List (0x000002AE75A5C9C0:'Unnamed ID3D12GraphicsCommandList Object'): Before state (0x4: D3D12_RESOURCE_STATE_RENDER_TARGET) of resource (0x000002AE75590920:'Unnamed ID3D12Resource Object') (subresource: 0) specified by transition barrier does not match with the state (0x0: D3D12_RESOURCE_STATE_[COMMON|PRESENT]) specified in the previous call to ResourceBarrier [ RESOURCE_MANIPULATION ERROR #527: RESOURCE_BARRIER_BEFORE_AFTER_MISMATCH]
D3D12 MESSAGE: GPU-BASED VALIDATION: TRACE BEGIN: PreDraw [ EXECUTION MESSAGE #1014: BEGIN_EVENT]
D3D12 MESSAGE: GPU-BASED VALIDATION: TRACE END: PreDraw [ EXECUTION MESSAGE #1015: END_EVENT]
D3D12 ERROR: GPU-BASED VALIDATION: DrawInstanced, RenderTarget state invalid, Slot [0], Incompatible resource state: Resource: 0x000002AE75590920:'Unnamed ID3D12Resource Object', Subresource Index: [0], Resource State: D3D12_RESOURCE_STATE_[COMMON|PRESENT](0x0), Required State Bits: D3D12_RESOURCE_STATE_RENDER_TARGET(0x4), Draw Count [0], Dispatch Count [0], Command List: 0x000002AE75A5C9C0:'Unnamed ID3D12GraphicsCommandList Object',  [ EXECUTION ERROR #942: GPU_BASED_VALIDATION_INCOMPATIBLE_RESOURCE_STATE]
D3D12 ERROR: GPU-BASED VALIDATION: ResourceBarrier, StateBefore invalid, Barrier array index [0], Incompatible resource state: Resource: 0x000002AE75590920:'Unnamed ID3D12Resource Object', Subresource Index: [0], Resource State: D3D12_RESOURCE_STATE_[COMMON|PRESENT](0x0), Required State Bits: D3D12_RESOURCE_STATE_RENDER_TARGET(0x4), Draw Count [0], Dispatch Count [0], Command List: 0x000002AE75A5C9C0:'Unnamed ID3D12GraphicsCommandList Object',  [ EXECUTION ERROR #942: GPU_BASED_VALIDATION_INCOMPATIBLE_RESOURCE_STATE]
D3D12 ERROR: ID3D12CommandList::DrawIndexedInstanced: No pipeline state has been set in this command list.  The runtime will use a default no-op pipeline state. [ EXECUTION ERROR #1045: COMMAND_LIST_PIPELINE_STATE_NOT_SET]
D3D12 ERROR: ID3D12CommandQueue::ExecuteCommandLists: Using Draw on Command List (0x000002AE75A5C9C0:'Unnamed ID3D12GraphicsCommandList Object'): Resource state (0x0: D3D12_RESOURCE_STATE_[COMMON|PRESENT]) of resource (0x000002AE7558FB70:'Unnamed ID3D12Resource Object') (subresource: 0) is invalid for use as a render target.  Expected State Bits (all): 0x4: D3D12_RESOURCE_STATE_RENDER_TARGET, Actual State: 0x0: D3D12_RESOURCE_STATE_[COMMON|PRESENT], Missing State: 0x4: D3D12_RESOURCE_STATE_RENDER_TARGET. [ EXECUTION ERROR #538: INVALID_SUBRESOURCE_STATE]

D3D11 log:

D3D11 ERROR: ID3D11DeviceContext::DrawIndexed: Vertex Shader - Pixel Shader linkage error: Signatures between stages are incompatible. The input stage requires Semantic/Index (COLOR,0) as input, but it is not provided by the output stage. [ EXECUTION ERROR #342: DEVICE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND]
D3D11 ERROR: ID3D11DeviceContext::DrawIndexed: Vertex Shader - Pixel Shader linkage error: Signatures between stages are incompatible. The input stage requires Semantic/Index (COLOR,0) as input, but it is not provided by the output stage. [ EXECUTION ERROR #342: DEVICE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND]
D3D11 ERROR: ID3D11DeviceContext::DrawIndexed: Vertex Shader - Pixel Shader linkage error: Signatures between stages are incompatible. The input stage requires Semantic/Index (COLOR,0) as input, but it is not provided by the output stage. [ EXECUTION ERROR #342: DEVICE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND]
D3D11 ERROR: ID3D11DeviceContext::DrawIndexed: Vertex Shader - Pixel Shader linkage error: Signatures between stages are incompatible. The input stage requires Semantic/Index (COLOR,0) as input, but it is not provided by the output stage. [ EXECUTION ERROR #342: DEVICE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND]
D3D11 ERROR: ID3D11DeviceContext::DrawIndexed: Vertex Shader - Pixel Shader linkage error: Signatures between stages are incompatible. The input stage requires Semantic/Index (COLOR,0) as input, but it is not provided by the output stage. [ EXECUTION ERROR #342: DEVICE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND]

Wayland?

Wayland Support

I wonder if there is support for Wayland from this library, and if not, make a pull request to add it myself. Wayland is designed to be very easy to develop, so I'd imagine it can be done in less than a few days most.

Currently from the brief look I've taken in the source code, it seems to me like it doesn't, so I'd be happy to help.

xwin_add_executable fails for specific project structure

If xwin_add_executable() is called from another folder than the one doing the inclusion of CrossWindow through add_subdirectory then the file provided by XMAIN_SOURCES is not found.
This comes from the fact that the file is defined relatively (https://github.com/alaingalvan/CrossWindow/blob/master/CMakeLists.txt#L116)
It makes sense to use relative for building CrossWindow lib but I think it is quite fragile to include a source into any existing project which might be placed anywhere.

In my situation, removing RELATIVE works.

_WIN32_WINNT definition

When building the library in windows there is some errors with the Windows.h definitions such as:

  • error: 'SetThreadDpiAwarenessContext' was not declared in this scope
  • error: 'GetDpiForWindow' was not declared in this scope

This is solved by defining the windows version as:
target_compile_definitions(CrossWindow PRIVATE _WIN32_WINNT=0x0A00) # Sets the windows version to windows 10

Maybe this should be handled by the internal CMakeLists like one of these solutions?

macOS link failure - Undefined symbols for architecture x86_64: "xmain(int, char const**)", referenced from: -[XWinApplication run] in CocoaMain.o

What am I doing wrong on my macOS 11.1 (20C69)?

CMakeLists.txt

cmake_minimum_required(VERSION 3.0)
cmake_policy(SET CMP0048 NEW)
project(pp VERSION 0.0.0 LANGUAGES CXX)

set(DCMAKE_GENERATOR_PLATFORM "x64")
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

set(src src/main.cpp)

add_subdirectory(external/crosswindow)

# โŽ When creating your executable use CrossWindow's abstraction function:
xwin_add_executable(
    # Target
    ${PROJECT_NAME}
    # Source Files (make sure to surround in quotations so CMake treats it as a list)
    "${SOURCE_FILES}"
)

set(libs CrossWindow)

if (APPLE) # or if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
    find_library(COCOA_LIBRARY Cocoa ONLY)
    #target_link_libraries(${PROJECT_NAME} PRIVATE ${COCOA_LIBRARY})
    set(libs ${libs};${COCOA_LIBRARY})
endif()

message("libs ${libs}")
# ๐Ÿ”— Link CrossWindow to your project:
target_link_libraries(${PROJECT_NAME} ${libs})

src/main.cpp

https://github.com/alaingalvan/CrossWindow/blob/b2d4f08/readme.md#usage

sh

$ git init && mkdir 'external' && cd "$_"
$ git submodule add https://github.com/alaingalvan/crosswindow.git
$ mkdir 'crosswindow/build' && cd "$_"
$ cmake -G 'Xcode' ..
$ cmake --build .
$ cd ../../..
$ tree -L 2
.
โ”œโ”€โ”€ CMakeLists.txt
โ”œโ”€โ”€ external
โ”‚ย ย  โ””โ”€โ”€ crosswindow
โ””โ”€โ”€ src
    โ””โ”€โ”€ main.cpp
$ mkdir build && cd $_
$ cmake -G 'Xcode' ..
-- The CXX compiler identification is AppleClang 12.0.0.12000032
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The C compiler identification is AppleClang 12.0.0.12000032
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Building CrossWindow for Cocoa
Creating CrossWindow executable:
libs CrossWindow;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/Cocoa.framework
-- Configuring done
-- Generating done
-- Build files have been written to: temp_dir/cross/build
$ cmake --build .
Command line invocation:
    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -project pp.xcodeproj build -target ALL_BUILD -parallelizeTargets -configuration Debug -hideShellScriptEnvironment

User defaults from command line:
    HideShellScriptEnvironment = YES

note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
CreateBuildDirectory temp_dir/cross/build/external/crosswindow (in target 'CrossWindow' from project 'pp')
    cd temp_dir/cross
    builtin-create-build-directory temp_dir/cross/build/external/crosswindow

CreateBuildDirectory temp_dir/cross/build (in target 'pp' from project 'pp')
    cd temp_dir/cross
    builtin-create-build-directory temp_dir/cross/build

WriteAuxiliaryFile temp_dir/cross/build/pp.build/Debug/ZERO_CHECK.build/Script-C15842543262D8CF4EC9B42F.sh (in target 'ZERO_CHECK' from project 'pp')
    cd temp_dir/cross
    write-file temp_dir/cross/build/pp.build/Debug/ZERO_CHECK.build/Script-C15842543262D8CF4EC9B42F.sh

MkDir temp_dir/cross/build/Debug/pp.app (in target 'pp' from project 'pp')
    cd temp_dir/cross
    /bin/mkdir -p temp_dir/cross/build/Debug/pp.app

MkDir temp_dir/cross/build/Debug/pp.app/Contents (in target 'pp' from project 'pp')
    cd temp_dir/cross
    /bin/mkdir -p temp_dir/cross/build/Debug/pp.app/Contents

MkDir temp_dir/cross/build/Debug/pp.app/Contents/MacOS (in target 'pp' from project 'pp')
    cd temp_dir/cross
    /bin/mkdir -p temp_dir/cross/build/Debug/pp.app/Contents/MacOS

PhaseScriptExecution Generate\ CMakeFiles/ZERO_CHECK temp_dir/cross/build/pp.build/Debug/ZERO_CHECK.build/Script-C15842543262D8CF4EC9B42F.sh (in target 'ZERO_CHECK' from project 'pp')
    cd temp_dir/cross
    /bin/sh -c temp_dir/cross/build/pp.build/Debug/ZERO_CHECK.build/Script-C15842543262D8CF4EC9B42F.sh
make: `temp_dir/cross/build/CMakeFiles/cmake.check_cache' is up to date.

CompileC temp_dir/cross/build/external/crosswindow/pp.build/Debug/CrossWindow.build/Objects-normal/x86_64/Dialogs.o temp_dir/cross/external/crosswindow/src/CrossWindow/Common/Dialogs.cpp normal x86_64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'CrossWindow' from project 'pp')
    cd temp_dir/cross
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c++ -target x86_64-apple-macos11.1 -fmessage-length\=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit\=0 -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-return-type -Wno-implicit-atomic-properties -Wno-objc-interface-ivars -Wno-arc-repeated-use-of-weak -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wno-unused-variable -Wunused-value -Wno-empty-body -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-bool-conversion -Wno-enum-conversion -Wno-float-conversion -Wno-non-literal-null-conversion -Wno-objc-literal-conversion -Wno-shorten-64-to-32 -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wno-undeclared-selector -Wno-deprecated-implementations -Wno-c++11-extensions -DCMAKE_INTDIR\=\"Debug\" -DXWIN_COCOA\=1 -DOBJC_OLD_DISPATCH_PROTOTYPES\=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -fasm-blocks -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -Winvalid-offsetof -g -Wno-sign-conversion -Wno-infinite-recursion -Wno-move -Wno-comma -Wno-block-capture-autoreleasing -Wno-strict-prototypes -Wno-range-loop-analysis -Wno-semicolon-before-method-body -Itemp_dir/cross/build/external/crosswindow/Debug/include -Itemp_dir/cross/external/crosswindow/src -Itemp_dir/cross/build/external/crosswindow/pp.build/Debug/CrossWindow.build/DerivedSources-normal/x86_64 -Itemp_dir/cross/build/external/crosswindow/pp.build/Debug/CrossWindow.build/DerivedSources/x86_64 -Itemp_dir/cross/build/external/crosswindow/pp.build/Debug/CrossWindow.build/DerivedSources -Ftemp_dir/cross/build/external/crosswindow/Debug -std\=c++14 -x objective-c++ -MMD -MT dependencies -MF temp_dir/cross/build/external/crosswindow/pp.build/Debug/CrossWindow.build/Objects-normal/x86_64/Dialogs.d --serialize-diagnostics temp_dir/cross/build/external/crosswindow/pp.build/Debug/CrossWindow.build/Objects-normal/x86_64/Dialogs.dia -c temp_dir/cross/external/crosswindow/src/CrossWindow/Common/Dialogs.cpp -o temp_dir/cross/build/external/crosswindow/pp.build/Debug/CrossWindow.build/Objects-normal/x86_64/Dialogs.o

CompileC temp_dir/cross/build/external/crosswindow/pp.build/Debug/CrossWindow.build/Objects-normal/x86_64/Init.o temp_dir/cross/external/crosswindow/src/CrossWindow/Common/Init.cpp normal x86_64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'CrossWindow' from project 'pp')
    cd temp_dir/cross
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c++ -target x86_64-apple-macos11.1 -fmessage-length\=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit\=0 -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-return-type -Wno-implicit-atomic-properties -Wno-objc-interface-ivars -Wno-arc-repeated-use-of-weak -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wno-unused-variable -Wunused-value -Wno-empty-body -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-bool-conversion -Wno-enum-conversion -Wno-float-conversion -Wno-non-literal-null-conversion -Wno-objc-literal-conversion -Wno-shorten-64-to-32 -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wno-undeclared-selector -Wno-deprecated-implementations -Wno-c++11-extensions -DCMAKE_INTDIR\=\"Debug\" -DXWIN_COCOA\=1 -DOBJC_OLD_DISPATCH_PROTOTYPES\=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -fasm-blocks -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -Winvalid-offsetof -g -Wno-sign-conversion -Wno-infinite-recursion -Wno-move -Wno-comma -Wno-block-capture-autoreleasing -Wno-strict-prototypes -Wno-range-loop-analysis -Wno-semicolon-before-method-body -Itemp_dir/cross/build/external/crosswindow/Debug/include -Itemp_dir/cross/external/crosswindow/src -Itemp_dir/cross/build/external/crosswindow/pp.build/Debug/CrossWindow.build/DerivedSources-normal/x86_64 -Itemp_dir/cross/build/external/crosswindow/pp.build/Debug/CrossWindow.build/DerivedSources/x86_64 -Itemp_dir/cross/build/external/crosswindow/pp.build/Debug/CrossWindow.build/DerivedSources -Ftemp_dir/cross/build/external/crosswindow/Debug -std\=c++14 -x objective-c++ -MMD -MT dependencies -MF temp_dir/cross/build/external/crosswindow/pp.build/Debug/CrossWindow.build/Objects-normal/x86_64/Init.d --serialize-diagnostics temp_dir/cross/build/external/crosswindow/pp.build/Debug/CrossWindow.build/Objects-normal/x86_64/Init.dia -c temp_dir/cross/external/crosswindow/src/CrossWindow/Common/Init.cpp -o temp_dir/cross/build/external/crosswindow/pp.build/Debug/CrossWindow.build/Objects-normal/x86_64/Init.o

WriteAuxiliaryFile temp_dir/cross/build/external/crosswindow/pp.build/Debug/CrossWindow.build/Objects-normal/x86_64/CrossWindow.LinkFileList (in target 'CrossWindow' from project 'pp')
    cd temp_dir/cross
    write-file temp_dir/cross/build/external/crosswindow/pp.build/Debug/CrossWindow.build/Objects-normal/x86_64/CrossWindow.LinkFileList

CompileC temp_dir/cross/build/external/crosswindow/pp.build/Debug/CrossWindow.build/Objects-normal/x86_64/WindowDesc.o temp_dir/cross/external/crosswindow/src/CrossWindow/Common/WindowDesc.cpp normal x86_64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'CrossWindow' from project 'pp')
    cd temp_dir/cross
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c++ -target x86_64-apple-macos11.1 -fmessage-length\=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit\=0 -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-return-type -Wno-implicit-atomic-properties -Wno-objc-interface-ivars -Wno-arc-repeated-use-of-weak -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wno-unused-variable -Wunused-value -Wno-empty-body -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-bool-conversion -Wno-enum-conversion -Wno-float-conversion -Wno-non-literal-null-conversion -Wno-objc-literal-conversion -Wno-shorten-64-to-32 -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wno-undeclared-selector -Wno-deprecated-implementations -Wno-c++11-extensions -DCMAKE_INTDIR\=\"Debug\" -DXWIN_COCOA\=1 -DOBJC_OLD_DISPATCH_PROTOTYPES\=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -fasm-blocks -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -Winvalid-offsetof -g -Wno-sign-conversion -Wno-infinite-recursion -Wno-move -Wno-comma -Wno-block-capture-autoreleasing -Wno-strict-prototypes -Wno-range-loop-analysis -Wno-semicolon-before-method-body -Itemp_dir/cross/build/external/crosswindow/Debug/include -Itemp_dir/cross/external/crosswindow/src -Itemp_dir/cross/build/external/crosswindow/pp.build/Debug/CrossWindow.build/DerivedSources-normal/x86_64 -Itemp_dir/cross/build/external/crosswindow/pp.build/Debug/CrossWindow.build/DerivedSources/x86_64 -Itemp_dir/cross/build/external/crosswindow/pp.build/Debug/CrossWindow.build/DerivedSources -Ftemp_dir/cross/build/external/crosswindow/Debug -std\=c++14 -x objective-c++ -MMD -MT dependencies -MF temp_dir/cross/build/external/crosswindow/pp.build/Debug/CrossWindow.build/Objects-normal/x86_64/WindowDesc.d --serialize-diagnostics temp_dir/cross/build/external/crosswindow/pp.build/Debug/CrossWindow.build/Objects-normal/x86_64/WindowDesc.dia -c temp_dir/cross/external/crosswindow/src/CrossWindow/Common/WindowDesc.cpp -o temp_dir/cross/build/external/crosswindow/pp.build/Debug/CrossWindow.build/Objects-normal/x86_64/WindowDesc.o

CompileC temp_dir/cross/build/external/crosswindow/pp.build/Debug/CrossWindow.build/Objects-normal/x86_64/CocoaWindow.o temp_dir/cross/external/crosswindow/src/CrossWindow/Cocoa/CocoaWindow.mm normal x86_64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'CrossWindow' from project 'pp')
    cd temp_dir/cross
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c++ -target x86_64-apple-macos11.1 -fmessage-length\=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit\=0 -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-return-type -Wno-implicit-atomic-properties -Wno-objc-interface-ivars -Wno-arc-repeated-use-of-weak -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wno-unused-variable -Wunused-value -Wno-empty-body -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-bool-conversion -Wno-enum-conversion -Wno-float-conversion -Wno-non-literal-null-conversion -Wno-objc-literal-conversion -Wno-shorten-64-to-32 -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wno-undeclared-selector -Wno-deprecated-implementations -Wno-c++11-extensions -DCMAKE_INTDIR\=\"Debug\" -DXWIN_COCOA\=1 -DOBJC_OLD_DISPATCH_PROTOTYPES\=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -fasm-blocks -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -Winvalid-offsetof -g -Wno-sign-conversion -Wno-infinite-recursion -Wno-move -Wno-comma -Wno-block-capture-autoreleasing -Wno-strict-prototypes -Wno-range-loop-analysis -Wno-semicolon-before-method-body -Itemp_dir/cross/build/external/crosswindow/Debug/include -Itemp_dir/cross/external/crosswindow/src -Itemp_dir/cross/build/external/crosswindow/pp.build/Debug/CrossWindow.build/DerivedSources-normal/x86_64 -Itemp_dir/cross/build/external/crosswindow/pp.build/Debug/CrossWindow.build/DerivedSources/x86_64 -Itemp_dir/cross/build/external/crosswindow/pp.build/Debug/CrossWindow.build/DerivedSources -Ftemp_dir/cross/build/external/crosswindow/Debug -std\=c++14 -x objective-c++ -MMD -MT dependencies -MF temp_dir/cross/build/external/crosswindow/pp.build/Debug/CrossWindow.build/Objects-normal/x86_64/CocoaWindow.d --serialize-diagnostics temp_dir/cross/build/external/crosswindow/pp.build/Debug/CrossWindow.build/Objects-normal/x86_64/CocoaWindow.dia -c temp_dir/cross/external/crosswindow/src/CrossWindow/Cocoa/CocoaWindow.mm -o temp_dir/cross/build/external/crosswindow/pp.build/Debug/CrossWindow.build/Objects-normal/x86_64/CocoaWindow.o
temp_dir/cross/external/crosswindow/src/CrossWindow/Cocoa/CocoaWindow.mm:190:13: warning: 'CAOpenGLLayer' is deprecated: first deprecated in macOS 10.14 - OpenGL is deprecated [-Wdeprecated-declarations]
                layer = [[CAOpenGLLayer alloc] init];
                          ^
In file included from temp_dir/cross/external/crosswindow/src/CrossWindow/Cocoa/CocoaWindow.mm:2:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:198:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSOpenGLLayer.h:11:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAOpenGLLayer.h:17:12: note: 'CAOpenGLLayer' has been explicitly marked deprecated here
@interface CAOpenGLLayer : CALayer
           ^
temp_dir/cross/external/crosswindow/src/CrossWindow/Cocoa/CocoaWindow.mm:191:30: warning: 'CAOpenGLLayer' is deprecated: first deprecated in macOS 10.14 - OpenGL is deprecated [-Wdeprecated-declarations]
                [(XWinView*)view setLayer:(CAOpenGLLayer*)layer];
                                           ^
In file included from temp_dir/cross/external/crosswindow/src/CrossWindow/Cocoa/CocoaWindow.mm:2:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:198:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSOpenGLLayer.h:11:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAOpenGLLayer.h:17:12: note: 'CAOpenGLLayer' has been explicitly marked deprecated here
@interface CAOpenGLLayer : CALayer
           ^
temp_dir/cross/external/crosswindow/src/CrossWindow/Cocoa/CocoaWindow.mm:192:3: warning: 'CAOpenGLLayer' is deprecated: first deprecated in macOS 10.14 - OpenGL is deprecated [-Wdeprecated-declarations]
                CAOpenGLLayer* l = ((CAOpenGLLayer*)layer);
                ^
In file included from temp_dir/cross/external/crosswindow/src/CrossWindow/Cocoa/CocoaWindow.mm:2:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:198:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSOpenGLLayer.h:11:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAOpenGLLayer.h:17:12: note: 'CAOpenGLLayer' has been explicitly marked deprecated here
@interface CAOpenGLLayer : CALayer
           ^
temp_dir/cross/external/crosswindow/src/CrossWindow/Cocoa/CocoaWindow.mm:192:24: warning: 'CAOpenGLLayer' is deprecated: first deprecated in macOS 10.14 - OpenGL is deprecated [-Wdeprecated-declarations]
                CAOpenGLLayer* l = ((CAOpenGLLayer*)layer);
                                     ^
In file included from temp_dir/cross/external/crosswindow/src/CrossWindow/Cocoa/CocoaWindow.mm:2:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:198:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSOpenGLLayer.h:11:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAOpenGLLayer.h:17:12: note: 'CAOpenGLLayer' has been explicitly marked deprecated here
@interface CAOpenGLLayer : CALayer
           ^
4 warnings generated.

CompileC temp_dir/cross/build/external/crosswindow/pp.build/Debug/CrossWindow.build/Objects-normal/x86_64/CocoaEventQueue.o temp_dir/cross/external/crosswindow/src/CrossWindow/Cocoa/CocoaEventQueue.mm normal x86_64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'CrossWindow' from project 'pp')
    cd temp_dir/cross
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c++ -target x86_64-apple-macos11.1 -fmessage-length\=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit\=0 -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-return-type -Wno-implicit-atomic-properties -Wno-objc-interface-ivars -Wno-arc-repeated-use-of-weak -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wno-unused-variable -Wunused-value -Wno-empty-body -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-bool-conversion -Wno-enum-conversion -Wno-float-conversion -Wno-non-literal-null-conversion -Wno-objc-literal-conversion -Wno-shorten-64-to-32 -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wno-undeclared-selector -Wno-deprecated-implementations -Wno-c++11-extensions -DCMAKE_INTDIR\=\"Debug\" -DXWIN_COCOA\=1 -DOBJC_OLD_DISPATCH_PROTOTYPES\=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -fasm-blocks -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -Winvalid-offsetof -g -Wno-sign-conversion -Wno-infinite-recursion -Wno-move -Wno-comma -Wno-block-capture-autoreleasing -Wno-strict-prototypes -Wno-range-loop-analysis -Wno-semicolon-before-method-body -Itemp_dir/cross/build/external/crosswindow/Debug/include -Itemp_dir/cross/external/crosswindow/src -Itemp_dir/cross/build/external/crosswindow/pp.build/Debug/CrossWindow.build/DerivedSources-normal/x86_64 -Itemp_dir/cross/build/external/crosswindow/pp.build/Debug/CrossWindow.build/DerivedSources/x86_64 -Itemp_dir/cross/build/external/crosswindow/pp.build/Debug/CrossWindow.build/DerivedSources -Ftemp_dir/cross/build/external/crosswindow/Debug -std\=c++14 -x objective-c++ -MMD -MT dependencies -MF temp_dir/cross/build/external/crosswindow/pp.build/Debug/CrossWindow.build/Objects-normal/x86_64/CocoaEventQueue.d --serialize-diagnostics temp_dir/cross/build/external/crosswindow/pp.build/Debug/CrossWindow.build/Objects-normal/x86_64/CocoaEventQueue.dia -c temp_dir/cross/external/crosswindow/src/CrossWindow/Cocoa/CocoaEventQueue.mm -o temp_dir/cross/build/external/crosswindow/pp.build/Debug/CrossWindow.build/Objects-normal/x86_64/CocoaEventQueue.o

CompileC temp_dir/cross/build/external/crosswindow/pp.build/Debug/CrossWindow.build/Objects-normal/x86_64/Event.o temp_dir/cross/external/crosswindow/src/CrossWindow/Common/Event.cpp normal x86_64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'CrossWindow' from project 'pp')
    cd temp_dir/cross
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c++ -target x86_64-apple-macos11.1 -fmessage-length\=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit\=0 -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-return-type -Wno-implicit-atomic-properties -Wno-objc-interface-ivars -Wno-arc-repeated-use-of-weak -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wno-unused-variable -Wunused-value -Wno-empty-body -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-bool-conversion -Wno-enum-conversion -Wno-float-conversion -Wno-non-literal-null-conversion -Wno-objc-literal-conversion -Wno-shorten-64-to-32 -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wno-undeclared-selector -Wno-deprecated-implementations -Wno-c++11-extensions -DCMAKE_INTDIR\=\"Debug\" -DXWIN_COCOA\=1 -DOBJC_OLD_DISPATCH_PROTOTYPES\=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -fasm-blocks -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -Winvalid-offsetof -g -Wno-sign-conversion -Wno-infinite-recursion -Wno-move -Wno-comma -Wno-block-capture-autoreleasing -Wno-strict-prototypes -Wno-range-loop-analysis -Wno-semicolon-before-method-body -Itemp_dir/cross/build/external/crosswindow/Debug/include -Itemp_dir/cross/external/crosswindow/src -Itemp_dir/cross/build/external/crosswindow/pp.build/Debug/CrossWindow.build/DerivedSources-normal/x86_64 -Itemp_dir/cross/build/external/crosswindow/pp.build/Debug/CrossWindow.build/DerivedSources/x86_64 -Itemp_dir/cross/build/external/crosswindow/pp.build/Debug/CrossWindow.build/DerivedSources -Ftemp_dir/cross/build/external/crosswindow/Debug -std\=c++14 -x objective-c++ -MMD -MT dependencies -MF temp_dir/cross/build/external/crosswindow/pp.build/Debug/CrossWindow.build/Objects-normal/x86_64/Event.d --serialize-diagnostics temp_dir/cross/build/external/crosswindow/pp.build/Debug/CrossWindow.build/Objects-normal/x86_64/Event.dia -c temp_dir/cross/external/crosswindow/src/CrossWindow/Common/Event.cpp -o temp_dir/cross/build/external/crosswindow/pp.build/Debug/CrossWindow.build/Objects-normal/x86_64/Event.o

WriteAuxiliaryFile temp_dir/cross/build/pp.build/Debug/pp.build/DerivedSources/Entitlements.plist (in target 'pp' from project 'pp')
    cd temp_dir/cross
    write-file temp_dir/cross/build/pp.build/Debug/pp.build/DerivedSources/Entitlements.plist

ProcessProductPackaging "" temp_dir/cross/build/pp.build/Debug/pp.build/pp.app.xcent (in target 'pp' from project 'pp')
    cd temp_dir/cross
    

Entitlements:

{
    "com.apple.security.get-task-allow" = 1;
}


    builtin-productPackagingUtility -entitlements -format xml -o temp_dir/cross/build/pp.build/Debug/pp.build/pp.app.xcent

CompileC temp_dir/cross/build/pp.build/Debug/pp.build/Objects-normal/x86_64/CocoaMain.o temp_dir/cross/external/crosswindow/src/CrossWindow/Main/CocoaMain.mm normal x86_64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'pp' from project 'pp')
    cd temp_dir/cross
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c++ -target x86_64-apple-macos11.1 -fmessage-length\=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit\=0 -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-return-type -Wno-implicit-atomic-properties -Wno-objc-interface-ivars -Wno-arc-repeated-use-of-weak -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wno-unused-variable -Wunused-value -Wno-empty-body -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-bool-conversion -Wno-enum-conversion -Wno-float-conversion -Wno-non-literal-null-conversion -Wno-objc-literal-conversion -Wno-shorten-64-to-32 -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wno-undeclared-selector -Wno-deprecated-implementations -Wno-c++11-extensions -DCMAKE_INTDIR\=\"Debug\" -DXWIN_COCOA\=1 -DOBJC_OLD_DISPATCH_PROTOTYPES\=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -fasm-blocks -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -Winvalid-offsetof -g -Wno-sign-conversion -Wno-infinite-recursion -Wno-move -Wno-comma -Wno-block-capture-autoreleasing -Wno-strict-prototypes -Wno-range-loop-analysis -Wno-semicolon-before-method-body -Itemp_dir/cross/build/Debug/include -Itemp_dir/cross/external/crosswindow/src -Itemp_dir/cross/build/pp.build/Debug/pp.build/DerivedSources-normal/x86_64 -Itemp_dir/cross/build/pp.build/Debug/pp.build/DerivedSources/x86_64 -Itemp_dir/cross/build/pp.build/Debug/pp.build/DerivedSources -Ftemp_dir/cross/build/Debug -std\=c++14 -MMD -MT dependencies -MF temp_dir/cross/build/pp.build/Debug/pp.build/Objects-normal/x86_64/CocoaMain.d --serialize-diagnostics temp_dir/cross/build/pp.build/Debug/pp.build/Objects-normal/x86_64/CocoaMain.dia -c temp_dir/cross/external/crosswindow/src/CrossWindow/Main/CocoaMain.mm -o temp_dir/cross/build/pp.build/Debug/pp.build/Objects-normal/x86_64/CocoaMain.o

Libtool temp_dir/cross/build/external/crosswindow/Debug/libCrossWindow.a normal (in target 'CrossWindow' from project 'pp')
    cd temp_dir/cross
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static -arch_only x86_64 -D -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -Ltemp_dir/cross/build/external/crosswindow/Debug -filelist temp_dir/cross/build/external/crosswindow/pp.build/Debug/CrossWindow.build/Objects-normal/x86_64/CrossWindow.LinkFileList -dependency_info temp_dir/cross/build/external/crosswindow/pp.build/Debug/CrossWindow.build/Objects-normal/x86_64/CrossWindow_libtool_dependency_info.dat -o temp_dir/cross/build/external/crosswindow/Debug/libCrossWindow.a
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: temp_dir/cross/build/external/crosswindow/pp.build/Debug/CrossWindow.build/Objects-normal/x86_64/Dialogs.o has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: temp_dir/cross/build/external/crosswindow/pp.build/Debug/CrossWindow.build/Objects-normal/x86_64/WindowDesc.o has no symbols

WriteAuxiliaryFile temp_dir/cross/build/pp.build/Debug/pp.build/Objects-normal/x86_64/pp.LinkFileList (in target 'pp' from project 'pp')
    cd temp_dir/cross
    write-file temp_dir/cross/build/pp.build/Debug/pp.build/Objects-normal/x86_64/pp.LinkFileList

ProcessInfoPlistFile temp_dir/cross/build/Debug/pp.app/Contents/Info.plist temp_dir/cross/build/CMakeFiles/pp.dir/Info.plist (in target 'pp' from project 'pp')
    cd temp_dir/cross
    builtin-infoPlistUtility temp_dir/cross/build/CMakeFiles/pp.dir/Info.plist -producttype com.apple.product-type.application -genpkginfo temp_dir/cross/build/Debug/pp.app/Contents/PkgInfo -expandbuildsettings -platform macosx -o temp_dir/cross/build/Debug/pp.app/Contents/Info.plist

Ld temp_dir/cross/build/Debug/pp.app/Contents/MacOS/pp normal (in target 'pp' from project 'pp')
    cd temp_dir/cross
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -target x86_64-apple-macos11.1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -Ltemp_dir/cross/build/Debug -Ftemp_dir/cross/build/Debug -filelist temp_dir/cross/build/pp.build/Debug/pp.build/Objects-normal/x86_64/pp.LinkFileList -Xlinker -object_path_lto -Xlinker temp_dir/cross/build/pp.build/Debug/pp.build/Objects-normal/x86_64/pp_lto.o -Xlinker -no_deduplicate -fobjc-link-runtime -Wl,-search_paths_first -Wl,-headerpad_max_install_names temp_dir/cross/build/external/crosswindow/Debug/libCrossWindow.a -framework Cocoa -framework QuartzCore -Xlinker -no_adhoc_codesign -Xlinker -dependency_info -Xlinker temp_dir/cross/build/pp.build/Debug/pp.build/Objects-normal/x86_64/pp_dependency_info.dat -o temp_dir/cross/build/Debug/pp.app/Contents/MacOS/pp
Undefined symbols for architecture x86_64:
  "xmain(int, char const**)", referenced from:
      -[XWinApplication run] in CocoaMain.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

** BUILD FAILED **


The following build commands failed:
	Ld temp_dir/cross/build/Debug/pp.app/Contents/MacOS/pp normal
(1 failure)

fails to build on mac os

Matthews-MacBook-Pro:example smallville7123$ rm -rf build/
Matthews-MacBook-Pro:example smallville7123$ cmake -B build
CMake Warning (dev) in CMakeLists.txt:
  No project() command is present.  The top-level CMakeLists.txt file must
  contain a literal, direct call to the project() command.  Add a line of
  code such as

    project(ProjectName)

  near the top of the file, but after cmake_minimum_required().

  CMake is pretending there is a "project(Project)" command on the first
  line.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- The C compiler identification is AppleClang 12.0.0.12000032
-- The CXX compiler identification is AppleClang 12.0.0.12000032
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Building CrossWindow for Cocoa
Creating CrossWindow executable:
CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 3.21)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring done
-- Generating done
-- Build files have been written to: /Users/smallville7123/git/CrossWindow/example/build
Matthews-MacBook-Pro:example smallville7123$ cmake --build build
[ 11%] Building CXX object CrossWindow/CMakeFiles/CrossWindow.dir/src/CrossWindow/Cocoa/CocoaEventQueue.mm.o
/Users/smallville7123/git/CrossWindow/src/CrossWindow/Cocoa/CocoaEventQueue.mm:17:63: error:
      use of undeclared identifier 'window'
  ...xwin::Event curEvent = xwin::Event(xwin::EventType::None, window);
                                                               ^
/Users/smallville7123/git/CrossWindow/src/CrossWindow/Cocoa/CocoaEventQueue.mm:76:37: error:
      use of undeclared identifier 'modifiers'
                xwin::ModifierState(modifiers & MK_CONTROL, modifiers & MK_ALT,
                                    ^
/Users/smallville7123/git/CrossWindow/src/CrossWindow/Cocoa/CocoaEventQueue.mm:76:49: error:
      use of undeclared identifier 'MK_CONTROL'
                xwin::ModifierState(modifiers & MK_CONTROL, modifiers & MK_ALT,
                                                ^
/Users/smallville7123/git/CrossWindow/src/CrossWindow/Cocoa/CocoaEventQueue.mm:76:61: error:
      use of undeclared identifier 'modifiers'
                xwin::ModifierState(modifiers & MK_CONTROL, modifiers & MK_ALT,
                                                            ^
/Users/smallville7123/git/CrossWindow/src/CrossWindow/Cocoa/CocoaEventQueue.mm:76:73: error:
      use of undeclared identifier 'MK_ALT'
                xwin::ModifierState(modifiers & MK_CONTROL, modifiers & MK_ALT,
                                                                        ^
/Users/smallville7123/git/CrossWindow/src/CrossWindow/Cocoa/CocoaEventQueue.mm:77:37: error:
      use of undeclared identifier 'modifiers'
                                    modifiers & MK_SHIFT, modifiers & 0)),
                                    ^
/Users/smallville7123/git/CrossWindow/src/CrossWindow/Cocoa/CocoaEventQueue.mm:77:49: error:
      use of undeclared identifier 'MK_SHIFT'
                                    modifiers & MK_SHIFT, modifiers & 0)),
                                                ^
/Users/smallville7123/git/CrossWindow/src/CrossWindow/Cocoa/CocoaEventQueue.mm:77:59: error:
      use of undeclared identifier 'modifiers'
                                    modifiers & MK_SHIFT, modifiers & 0)),
                                                          ^
/Users/smallville7123/git/CrossWindow/src/CrossWindow/Cocoa/CocoaEventQueue.mm:78:13: error:
      use of undeclared identifier 'window'
            window);
            ^
/Users/smallville7123/git/CrossWindow/src/CrossWindow/Cocoa/CocoaEventQueue.mm:84:37: error:
      use of undeclared identifier 'modifiers'
                xwin::ModifierState(modifiers & MK_CONTROL, modifiers & MK_ALT,
                                    ^
/Users/smallville7123/git/CrossWindow/src/CrossWindow/Cocoa/CocoaEventQueue.mm:84:49: error:
      use of undeclared identifier 'MK_CONTROL'
                xwin::ModifierState(modifiers & MK_CONTROL, modifiers & MK_ALT,
                                                ^
/Users/smallville7123/git/CrossWindow/src/CrossWindow/Cocoa/CocoaEventQueue.mm:84:61: error:
      use of undeclared identifier 'modifiers'
                xwin::ModifierState(modifiers & MK_CONTROL, modifiers & MK_ALT,
                                                            ^
/Users/smallville7123/git/CrossWindow/src/CrossWindow/Cocoa/CocoaEventQueue.mm:84:73: error:
      use of undeclared identifier 'MK_ALT'
                xwin::ModifierState(modifiers & MK_CONTROL, modifiers & MK_ALT,
                                                                        ^
/Users/smallville7123/git/CrossWindow/src/CrossWindow/Cocoa/CocoaEventQueue.mm:85:37: error:
      use of undeclared identifier 'modifiers'
                                    modifiers & MK_SHIFT, modifiers & 0)),
                                    ^
/Users/smallville7123/git/CrossWindow/src/CrossWindow/Cocoa/CocoaEventQueue.mm:85:49: error:
      use of undeclared identifier 'MK_SHIFT'
                                    modifiers & MK_SHIFT, modifiers & 0)),
                                                ^
/Users/smallville7123/git/CrossWindow/src/CrossWindow/Cocoa/CocoaEventQueue.mm:85:59: error:
      use of undeclared identifier 'modifiers'
                                    modifiers & MK_SHIFT, modifiers & 0)),
                                                          ^
/Users/smallville7123/git/CrossWindow/src/CrossWindow/Cocoa/CocoaEventQueue.mm:86:13: error:
      use of undeclared identifier 'window'
            window);
            ^
/Users/smallville7123/git/CrossWindow/src/CrossWindow/Cocoa/CocoaEventQueue.mm:92:37: error:
      use of undeclared identifier 'modifiers'
                xwin::ModifierState(modifiers & MK_CONTROL, modifiers & MK_ALT,
                                    ^
/Users/smallville7123/git/CrossWindow/src/CrossWindow/Cocoa/CocoaEventQueue.mm:92:49: error:
      use of undeclared identifier 'MK_CONTROL'
                xwin::ModifierState(modifiers & MK_CONTROL, modifiers & MK_ALT,
                                                ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [CrossWindow/CMakeFiles/CrossWindow.dir/src/CrossWindow/Cocoa/CocoaEventQueue.mm.o] Error 1
make[1]: *** [CrossWindow/CMakeFiles/CrossWindow.dir/all] Error 2
make: *** [all] Error 2
Matthews-MacBook-Pro:example smallville7123$

No window close button on Win32 window?

image

#include <CrossWindow/CrossWindow.h>
#include <cassert>

void xmain(int argc, const char** argv)
{
    xwin::WindowDesc window_desc;
    window_desc.name = "test";
    window_desc.title = "Vulkan Playground";
    window_desc.width = 1280;
    window_desc.height = 720;
    window_desc.visible = true;
    window_desc.closable = true;

    xwin::EventQueue event_queue;

    xwin::Window window;
    if (!window.create(window_desc, event_queue))
    {
        assert(false);
        return;
    }

    bool is_running = true;
    while (is_running)
    {
        event_queue.update();
        while (!event_queue.empty())
        {
            const auto& event = event_queue.front();
            if (event.type == xwin::EventType::Close)
            {
                window.close();
                is_running = false;
            }
            else if (event.type == xwin::EventType::Keyboard)
            {
                if (event.data.keyboard.state == xwin::ButtonState::Pressed && event.data.keyboard.key == xwin::Key::Escape)
                {
                    window.close();
                    is_running = false;
                }
            }
            event_queue.pop();
        }

    }
}

Commit d24b01b

Not compiling on linux.

I tried to follow your vulkan tutorial but i cant compile crosswindow. I tried using G++,Clang++, switching between XCB and XLIB, but nothing work. I have all required libs.

arch@btw /mnt/shared/InfiniteEngine/build (git)-[master] % cmake ..       
-- Installing crosswindow via submodule
-- Building CrossWindow for XCB
-- Installing crosswindow-graphics via submodule
-- Using the Vulkan graphics API with CrossWindow
-- Installing glm via submodule
Creating CrossWindow executable:
-- Configuring done
-- Generating done
-- Build files have been written to: /mnt/shared/InfiniteEngine/build
arch@btw /mnt/shared/InfiniteEngine/build (git)-[master] % cmake --build .
[ 15%] Built target glm_static
[ 23%] Building CXX object external/crosswindow/CMakeFiles/CrossWindow.dir/src/CrossWindow/XCB/XCBEventQueue.cpp.o
In file included from /mnt/shared/InfiniteEngine/external/crosswindow/src/CrossWindow/XCB/XCBEventQueue.cpp:1:
/mnt/shared/InfiniteEngine/external/crosswindow/src/CrossWindow/XCB/XCBEventQueue.h:28:24: error: unknown type name 'xcb_generic_event_t'
        void pushEvent(xcb_generic_event_t me);
                       ^
/mnt/shared/InfiniteEngine/external/crosswindow/src/CrossWindow/XCB/XCBEventQueue.cpp:7:15: error: unknown type name 'XWinState'
        const XWinState& xwinState = getXWinState();
              ^
/mnt/shared/InfiniteEngine/external/crosswindow/src/CrossWindow/XCB/XCBEventQueue.cpp:7:38: error: use of undeclared identifier 'getXWinState'
        const XWinState& xwinState = getXWinState();
                                     ^
/mnt/shared/InfiniteEngine/external/crosswindow/src/CrossWindow/XCB/XCBEventQueue.cpp:8:9: error: use of undeclared identifier 'mConnection'
        mConnection = xwinState.connection;
        ^
/mnt/shared/InfiniteEngine/external/crosswindow/src/CrossWindow/XCB/XCBEventQueue.cpp:11:25: error: return type of out-of-line definition of 'xwin::XCBEventQueue::update' differs from that in the declaration
    bool XCBEventQueue::update()
    ~~~~                ^
/mnt/shared/InfiniteEngine/external/crosswindow/src/CrossWindow/XCB/XCBEventQueue.h:19:14: note: previous declaration is here
        void update();
        ~~~~ ^
/mnt/shared/InfiniteEngine/external/crosswindow/src/CrossWindow/XCB/XCBEventQueue.cpp:13:20: error: use of undeclared identifier 'connection'
         xcb_flush(connection);
                   ^
/mnt/shared/InfiniteEngine/external/crosswindow/src/CrossWindow/XCB/XCBEventQueue.cpp:14:29: error: use of undeclared identifier 'connection'
         xcb_wait_for_event(connection);
                            ^
/mnt/shared/InfiniteEngine/external/crosswindow/src/CrossWindow/XCB/XCBEventQueue.cpp:15:9: error: unknown type name 'xcb_generic_event_t'
        xcb_generic_event_t* e;
        ^
/mnt/shared/InfiniteEngine/external/crosswindow/src/CrossWindow/XCB/XCBEventQueue.cpp:16:39: error: use of undeclared identifier 'mConnection'
        while (e = xcb_poll_for_event(mConnection)) {
                                      ^
/mnt/shared/InfiniteEngine/external/crosswindow/src/CrossWindow/XCB/XCBEventQueue.cpp:22:41: error: unknown type name 'xcb_generic_event_t'
    void XCBEventQueue::pushEvent(const xcb_generic_event_t *event) {
                                        ^
/mnt/shared/InfiniteEngine/external/crosswindow/src/CrossWindow/XCB/XCBEventQueue.cpp:24:9: error: unknown type name 'uint8_t'
        uint8_t event_code = event->response_type & 0x7f;
        ^
/mnt/shared/InfiniteEngine/external/crosswindow/src/CrossWindow/XCB/XCBEventQueue.cpp:26:14: error: use of undeclared identifier 'XCB_CONFIGURE_NOTIFY'
        case XCB_CONFIGURE_NOTIFY:
             ^
/mnt/shared/InfiniteEngine/external/crosswindow/src/CrossWindow/XCB/XCBEventQueue.cpp:31:14: error: use of undeclared identifier 'XCB_EXPOSE'
        case XCB_EXPOSE:
             ^
/mnt/shared/InfiniteEngine/external/crosswindow/src/CrossWindow/XCB/XCBEventQueue.cpp:36:14: error: use of undeclared identifier 'XCB_ENTER_NOTIFY'
        case XCB_ENTER_NOTIFY:
             ^
/mnt/shared/InfiniteEngine/external/crosswindow/src/CrossWindow/XCB/XCBEventQueue.cpp:41:14: error: use of undeclared identifier 'XCB_LEAVE_NOTIFY'
        case XCB_LEAVE_NOTIFY:
             ^
/mnt/shared/InfiniteEngine/external/crosswindow/src/CrossWindow/XCB/XCBEventQueue.cpp:46:14: error: use of undeclared identifier 'XCB_CLIENT_MESSAGE'
        case XCB_CLIENT_MESSAGE:
             ^
/mnt/shared/InfiniteEngine/external/crosswindow/src/CrossWindow/XCB/XCBEventQueue.cpp:48:20: error: use of undeclared identifier 'xcb_client_message_event_t'
            if ((*(xcb_client_message_event_t *)event).data.data32[0] == (*demo->atom_wm_delete_window).atom)
                   ^
/mnt/shared/InfiniteEngine/external/crosswindow/src/CrossWindow/XCB/XCBEventQueue.cpp:48:48: error: expected expression
            if ((*(xcb_client_message_event_t *)event).data.data32[0] == (*demo->atom_wm_delete_window).atom)
                                               ^
/mnt/shared/InfiniteEngine/external/crosswindow/src/CrossWindow/XCB/XCBEventQueue.cpp:48:76: error: use of undeclared identifier 'demo'
            if ((*(xcb_client_message_event_t *)event).data.data32[0] == (*demo->atom_wm_delete_window).atom)
                                                                           ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [external/crosswindow/CMakeFiles/CrossWindow.dir/build.make:132: external/crosswindow/CMakeFiles/CrossWindow.dir/src/CrossWindow/XCB/XCBEventQueue.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:163: external/crosswindow/CMakeFiles/CrossWindow.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
2 arch@btw /mnt/shared/InfiniteEngine/build (git)-[master] %      

Audio support?

Will there be audio support added to the library. If no what's the simplest way to implement it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.