mirror of
https://github.com/janet-lang/janet
synced 2025-12-06 08:38:07 +00:00
Local changes.
This commit is contained in:
@@ -1,34 +0,0 @@
|
||||
# Copyright (c) 2017 Calvin Rose
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to
|
||||
# deal in the Software without restriction, including without limitation the
|
||||
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
# sell copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
# IN THE SOFTWARE.
|
||||
|
||||
cmake_minimum_required(VERSION 3.7)
|
||||
project(hello)
|
||||
|
||||
# Set Some Variables
|
||||
set(TARGET_NAME "hello")
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
|
||||
|
||||
set(SOURCES main.c)
|
||||
|
||||
include_directories(../../src/include)
|
||||
|
||||
# Build the module
|
||||
add_library(${TARGET_NAME} SHARED ${SOURCES})
|
||||
49
natives/hello/build.bat
Normal file
49
natives/hello/build.bat
Normal file
@@ -0,0 +1,49 @@
|
||||
@rem Build dst on windows
|
||||
@rem
|
||||
@rem Open a "Windows SDK Command Shell" and cd to the dst directory
|
||||
@rem Then run this script with no arguments to build the executable
|
||||
|
||||
@echo off
|
||||
|
||||
@rem Ensure correct command prompt
|
||||
@if not defined INCLUDE goto :BADCMD
|
||||
|
||||
@rem Subcommands
|
||||
@if "%1"=="clean" goto CLEAN
|
||||
|
||||
@rem Set compile and link options here
|
||||
@setlocal
|
||||
@set DST_COMPILE=cl /nologo /I..\..\src\include /c /O2 /W3
|
||||
@set DST_LINK=link /nologo /dll ..\..\dst.lib
|
||||
|
||||
@rem Build the sources
|
||||
for %%f in (*.c) do (
|
||||
@%DST_COMPILE% %%f
|
||||
@if errorlevel 1 goto :BUILDFAIL
|
||||
)
|
||||
|
||||
%DST_LINK% /out:hello.dll *.obj
|
||||
@if errorlevel 1 goto :BUILDFAIL
|
||||
|
||||
echo === Successfully built hello.dll for Windows ===
|
||||
echo === Run 'build clean' to delete build artifacts. ===
|
||||
exit /b 0
|
||||
|
||||
@rem Not using correct command line
|
||||
:BADCMD
|
||||
@echo Use a Visual Studio Developer Command Prompt to run this script
|
||||
exit /b 1
|
||||
|
||||
@rem Clean build artifacts
|
||||
:CLEAN
|
||||
del *.obj
|
||||
del hello.*
|
||||
exit /b 0
|
||||
|
||||
@rem Build failed
|
||||
:BUILDFAIL
|
||||
@echo.
|
||||
@echo *******************************************************
|
||||
@echo *** Build FAILED -- Please check the error messages ***
|
||||
@echo *******************************************************
|
||||
exit /b 1
|
||||
@@ -35,7 +35,7 @@ static const DstReg cfuns[] = {
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
int _dst_init(DstArgs args) {
|
||||
DST_MODULE_ENTRY (DstArgs args) {
|
||||
DstTable *env = dst_env_arg(args);
|
||||
dst_env_cfuns(env, cfuns);
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user