Add build scripts and update .gitignore
This commit introduces build scripts for both Windows (`build.bat`) and Linux/macOS (`build.sh`) to simplify the build process. It also updates the `.gitignore` file to a more comprehensive version that includes common patterns for C++ projects and various IDEs.
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
#include "Library.h"
|
||||
|
||||
int add(int a, int b) {
|
||||
return a + b;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
// Define MY_LIB_EXPORT for exporting symbols from the DLL
|
||||
#if defined(_WIN32)
|
||||
#if defined(MY_LIB_EXPORT)
|
||||
#define MY_LIB_API __declspec(dllexport)
|
||||
#else
|
||||
#define MY_LIB_API __declspec(dllimport)
|
||||
#endif
|
||||
#else
|
||||
#define MY_LIB_API
|
||||
#endif
|
||||
|
||||
// A simple function to be exported
|
||||
MY_LIB_API int add(int a, int b);
|
||||
Reference in New Issue
Block a user