build cleanup
This commit is contained in:
parent
daeb385bba
commit
42d712a26b
|
@ -1,10 +1,5 @@
|
||||||
@ECHO OFF
|
@ECHO OFF
|
||||||
|
|
||||||
REM cd build && cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -GNinja .. && ninja && copy compile_commands.json .. && skunkworks.exe
|
cl build.c src/str.c src/types.c /Iinclude && del *.obj && build.exe && del build.exe && build\gsa_simple.exe
|
||||||
|
|
||||||
REM cd build && meson compile && copy compile_commands.json .. && cd .. && build\gsa.exe
|
|
||||||
clang build.c src/str.c src/types.c -Iinclude -Wno-everything -obuild.exe && build.exe && del build.exe && build\gsa_simple.exe
|
|
||||||
EXIT /B %ERRORLEVEL%
|
EXIT /B %ERRORLEVEL%
|
||||||
REM build\skip.exe c src && exit /b 1
|
|
||||||
REM build\gsa.exe
|
|
||||||
|
|
||||||
|
|
9
em.ini
9
em.ini
|
@ -1,9 +0,0 @@
|
||||||
[binaries]
|
|
||||||
c = ['c:/dev/_tools/emsdk/upstream/emscripten/emcc.bat']
|
|
||||||
ar =['c:/dev/_tools/emsdk/upstream/emscripten/emar.bat']
|
|
||||||
|
|
||||||
[host_machine]
|
|
||||||
system = 'emscripten'
|
|
||||||
cpu_family = 'wasm'
|
|
||||||
cpu = 'wasm'
|
|
||||||
endian = 'little'
|
|
91
meson.build
91
meson.build
|
@ -1,91 +0,0 @@
|
||||||
project('skunkworks', 'c',
|
|
||||||
default_options: [
|
|
||||||
'buildtype=release',
|
|
||||||
'strip=true',
|
|
||||||
'debug=false'
|
|
||||||
]
|
|
||||||
)
|
|
||||||
|
|
||||||
cmake = import('cmake')
|
|
||||||
|
|
||||||
opt = cmake.subproject_options()
|
|
||||||
#opt.add_cmake_defines({'MSVC': true})
|
|
||||||
libz = cmake.subproject('zlib-1.2.13', options: opt).dependency('zlibstatic')
|
|
||||||
|
|
||||||
opt = cmake.subproject_options()
|
|
||||||
opt.add_cmake_defines({
|
|
||||||
'ZLIB_INCLUDE_DIRS': 'subprojects/zlib-1.2.13',
|
|
||||||
'PNG_BUILD_ZLIB': true,
|
|
||||||
'PNG_SHARED': false,
|
|
||||||
'PNG_STATIC': true,
|
|
||||||
'PNG_EXECUTABLES': false,
|
|
||||||
'PNG_TESTS': false,
|
|
||||||
'BUILD_SHARED_LIBS': false,
|
|
||||||
'SKIP_INSTALL_ALL': true
|
|
||||||
})
|
|
||||||
opt.append_compile_args('c', '-I../subprojects/zlib-1.2.13', '-Isubprojects/zlib-1.2.13/__CMake_build')
|
|
||||||
libpng = cmake.subproject('lpng1639', options: opt).dependency('png_static')
|
|
||||||
|
|
||||||
opt = cmake.subproject_options()
|
|
||||||
opt.add_cmake_defines({'GLFW_BUILD_DOCS': false})
|
|
||||||
|
|
||||||
|
|
||||||
if host_machine.system() == 'emscripten'
|
|
||||||
#libglfw = meson.get_compiler('c').find_library('glfw')
|
|
||||||
deps = [libz, libpng]
|
|
||||||
else
|
|
||||||
libglfw = cmake.subproject('glfw-3.3.8', options: opt).dependency('glfw')
|
|
||||||
libglew = subproject('glew-2.1.0').get_variable('libglew_dep')
|
|
||||||
deps = [libz, libpng, libglew, libglfw]
|
|
||||||
endif
|
|
||||||
|
|
||||||
skunk_sources = [
|
|
||||||
'src/color32.c',
|
|
||||||
'src/error.c',
|
|
||||||
'src/file.c',
|
|
||||||
'src/framebuffer.c',
|
|
||||||
'src/gamepad.c',
|
|
||||||
'src/gsa.c',
|
|
||||||
'src/gsa_input.c',
|
|
||||||
'src/gsa_map.c',
|
|
||||||
'src/gsa_text.c',
|
|
||||||
'src/image32.c',
|
|
||||||
'src/image8.c',
|
|
||||||
'src/scaler.c',
|
|
||||||
'src/shader.c',
|
|
||||||
'src/shaders.c',
|
|
||||||
'src/skip.c',
|
|
||||||
'src/skunkworks.c',
|
|
||||||
'src/str.c',
|
|
||||||
'src/types.c',
|
|
||||||
'src/vec2i.c',
|
|
||||||
'src/window.c'
|
|
||||||
]
|
|
||||||
|
|
||||||
xxd = find_program('xxd')
|
|
||||||
cmd = find_program('cmd')
|
|
||||||
embed_gfx = custom_target('embed-gfx', input: ['gfx.png'], output: ['embed_gfx.h'],
|
|
||||||
command: [xxd, '-i', '@INPUT@', '@OUTPUT@'])
|
|
||||||
|
|
||||||
add_project_arguments('-D_CRT_SECURE_NO_WARNINGS', language : 'c')
|
|
||||||
add_project_arguments('-Wall', language : 'c')
|
|
||||||
add_project_arguments('-Wextra', language : 'c')
|
|
||||||
add_project_arguments('-Werror', language : 'c')
|
|
||||||
|
|
||||||
lib = static_library('skunkworks', skunk_sources, include_directories: 'include', dependencies: deps)
|
|
||||||
|
|
||||||
if host_machine.system() == 'emscripten'
|
|
||||||
executable('skunktest', link_with: lib, include_directories: 'include', dependencies: deps, link_args: ['-lglfw', '-lGL', '-s', 'USE_GLFW=3'], name_suffix: 'html')
|
|
||||||
executable('gsa', 'examples/gsa_simple.c', embed_gfx, link_with: lib, include_directories: 'include', dependencies: deps, link_args: ['-lglfw', '-lGL', '-s', 'USE_GLFW=3', '-s', 'ALLOW_MEMORY_GROWTH', '-s', 'FULL_ES3'], name_suffix: 'html')
|
|
||||||
else
|
|
||||||
skip = executable('skip', 'tools/skip.c', link_with: lib, include_directories: 'include', dependencies: deps)
|
|
||||||
executable('skunktest', 'src/test.c', link_with: lib, include_directories: 'include', dependencies: deps)
|
|
||||||
gsa = executable('gsa', 'examples/gsa_simple.c', embed_gfx, link_with: lib, include_directories: 'include', dependencies: deps)
|
|
||||||
# custom_target(
|
|
||||||
# 'gsa skip',
|
|
||||||
# input: gsa,
|
|
||||||
# output: 'fake',
|
|
||||||
# command: ['skip.exe', 'ca1', '..\src', gsa],
|
|
||||||
# build_by_default: true
|
|
||||||
# )
|
|
||||||
endif
|
|
|
@ -1,3 +0,0 @@
|
||||||
[binaries]
|
|
||||||
c = 'clang'
|
|
||||||
c_ld = 'lld'
|
|
|
@ -1,3 +0,0 @@
|
||||||
@echo off
|
|
||||||
|
|
||||||
meson setup --native-file native.ini build
|
|
|
@ -1,2 +0,0 @@
|
||||||
@echo off
|
|
||||||
meson setup --cross-file=em.ini --prefer-static buildem
|
|
Loading…
Reference in New Issue