Skip to content

C++ rewrite #4

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,7 @@ dist
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

cmake-build-debug/
dist/
build/
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .idea/autoit-js.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

159 changes: 159 additions & 0 deletions .idea/codeStyles/Project.xml

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

104 changes: 104 additions & 0 deletions .idea/editor.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# This file is mostly here to aid IDE IntelliSense, I don't think CMake can be used to build the project on its own.

cmake_minimum_required(VERSION 3.28)
project(autoit_js)

# Wanna use C++23, but MSVC doesn't support it yet... Microsoft is cringe.
set(CMAKE_CXX_STANDARD 17)

include_directories(${CMAKE_JS_INC} "${CMAKE_CURRENT_SOURCE_DIR}/node_modules/node-api-headers/include")
include_directories(${CMAKE_JS_INC} "${CMAKE_CURRENT_SOURCE_DIR}/node_modules/node-addon-api")

file(GLOB_RECURSE AUTOIT_JS_SRC
"src/*.cpp"
"src/*.h"
)

add_library(autoit_js SHARED ${AUTOIT_JS_SRC})
27 changes: 27 additions & 0 deletions binding.gyp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"targets": [
{
"target_name": "autoit_js",
"sources": ["<!@(node scripts/list-source-files.js)"],
"include_dirs": ["<!(node -p \"require('node-addon-api').include\")"],
"dependencies": [
"<!(node -p \"require('node-addon-api').targets\"):node_addon_api"
],
"cflags!": ["-fno-exceptions"],
"cflags_cc!": ["-fno-exceptions"],
"cflags_cc": ["-std=c++17"],
"defines": ["NAPI_DISABLE_CPP_EXCEPTIONS"],
"copies": [
{
"files": ["./src/autoit/AutoItX3_x64.dll"],
"destination": "<(PRODUCT_DIR)",
}
],
"msvs_settings": {
"VCCLCompilerTool": {
"AdditionalOptions": ["/Zc:__cplusplus", "-std:c++17"]
}
},
}
]
}
Loading