pocketlang/SConscript

45 lines
931 B
Python
Raw Normal View History

2021-02-07 15:40:00 +08:00
Import('env')
import os
2021-05-08 18:54:07 +08:00
env.PROJECT_NAME = "pocketlang"
env.RUN_TARGET = os.path.join(env['variant_dir'], 'bin/pocket')
2021-02-07 15:40:00 +08:00
2021-05-08 18:54:07 +08:00
## TODO: automate types file generation.
## PocketLang source files
2021-02-07 15:40:00 +08:00
SOURCES = [
Glob('src/*.c'),
Glob('src/types/gen/*.c'),
]
2021-05-08 18:54:07 +08:00
if env['lib_shared']:
## Compile pocketlang dynamic lib.
dll = env.SharedLibrary(
target = 'bin/pocket' + env['bin_suffix'],
source = SOURCES,
CPPPATH = ['include/'],
CPPDEFINES = [env['CPPDEFINES'], 'MS_DLL', 'MS_COMPILE'],
)
else:
## Compile pocketlang static lib.
lib = env.Library(
target = 'bin/pocket' + env['bin_suffix'],
source = SOURCES,
CPPPATH = ['include/'],
)
## Test executable
test = env.Program(
target = 'bin/pocket' + env['bin_suffix'],
source = ['src/main/main.c'],
CPPPATH = ['include/'],
LIBPATH = 'bin',
LIBS = 'pocket' + env['bin_suffix'],
)
env.Append(CPPPATH=['include/'])
Requires(test, lib)
2021-02-07 15:40:00 +08:00