Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SharedLib example for Windows #175

Merged
merged 1 commit into from
Dec 6, 2023
Merged

Conversation

ennerf
Copy link
Contributor

@ennerf ennerf commented Nov 15, 2023

This PR adds an example for compiling against the shared library generated on Windows.

Setup substrate snapshot

Install substrate PR 1235 to the local maven repo: gradlew publishToMavenLocal

and modify the pom.xml:

<plugin>
    <groupId>com.gluonhq</groupId>
    <artifactId>gluonfx-maven-plugin</artifactId>
    <version>${gluonfx.maven.plugin.version}</version>
    <configuration>
        <target>${gluonfx.target}</target>
    </configuration>

    <!-- Use the snapshot build of substrate -->
    <dependencies>
        <dependency>
            <groupId>com.gluonhq</groupId>
            <artifactId>substrate</artifactId>
            <version>0.0.61-SNAPSHOT</version>
        </dependency>
    </dependencies>

</plugin>

Build on Windows

mvn gluonfx:sharedlib
run.bat

The output should be:

**********************************************************************
** Visual Studio 2022 Developer Command Prompt v17.6.3
** Copyright (c) 2022 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'

E:\gluon\gluon-samples\HelloSharedLib>run
Microsoft (R) C/C++ Optimizing Compiler Version 19.36.32534 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

example.cpp
Microsoft (R) Incremental Linker Version 14.36.32534.0
Copyright (C) Microsoft Corporation.  All rights reserved.

/out:example.exe
target\gluonfx\x86_64-windows\HelloSharedLib.lib
/out:target\gluonfx\x86_64-windows\example.exe
example.obj
Sum: 3
Diff: -1
Text: Hello from Java

@jperedadnr jperedadnr merged commit 91a06cf into gluonhq:master Dec 6, 2023
@ennerf ennerf deleted the windows-sharedlib branch December 6, 2023 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants