Skip to content

Commit

Permalink
Update builds to use pcre2
Browse files Browse the repository at this point in the history
CMake now has to specify each pcre file individually, as some are not meant to be compiled by themselves.
  • Loading branch information
tobil4sk committed Feb 19, 2022
1 parent 16f797b commit 2e98a47
Show file tree
Hide file tree
Showing 5 changed files with 166 additions and 72 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ ReleaseStatic
/src/Makefile
/include/ffmpeg
shiroLibs
.vs/
ReleaseVS*
/include/bullet
/libs/bullet/sample/sample.js
Expand Down
32 changes: 29 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,33 @@ include_directories(
)

file(GLOB pcre_srcs
include/pcre/*.c
include/pcre/pcre2_auto_possess.c
include/pcre/pcre2_chartables.c
include/pcre/pcre2_compile.c
include/pcre/pcre2_config.c
include/pcre/pcre2_context.c
include/pcre/pcre2_convert.c
include/pcre/pcre2_dfa_match.c
include/pcre/pcre2_error.c
include/pcre/pcre2_extuni.c
include/pcre/pcre2_find_bracket.c
include/pcre/pcre2_jit_compile.c
include/pcre/pcre2_maketables.c
include/pcre/pcre2_match_data.c
include/pcre/pcre2_match.c
include/pcre/pcre2_newline.c
include/pcre/pcre2_ord2utf.c
include/pcre/pcre2_pattern_info.c
include/pcre/pcre2_script_run.c
include/pcre/pcre2_serialize.c
include/pcre/pcre2_string_utils.c
include/pcre/pcre2_study.c
include/pcre/pcre2_substitute.c
include/pcre/pcre2_substring.c
include/pcre/pcre2_tables.c
include/pcre/pcre2_ucd.c
include/pcre/pcre2_valid_utf.c
include/pcre/pcre2_xclass.c
)
file(GLOB std_srcs
src/std/array.c
Expand Down Expand Up @@ -133,7 +159,7 @@ set_target_properties(libhl
PROPERTIES
VERSION ${HL_VERSION}
SOVERSION ${HL_VERSION_MAJOR}
COMPILE_DEFINITIONS "_USRDLL;LIBHL_EXPORTS"
COMPILE_DEFINITIONS "_USRDLL;LIBHL_EXPORTS;HAVE_CONFIG_H;PCRE2_CODE_UNIT_WIDTH=16"
)

add_executable(hl
Expand All @@ -142,7 +168,7 @@ add_executable(hl
src/main.c
src/module.c
src/debugger.c
src/profile.c
src/profile.c
)

target_link_libraries(hl libhl)
Expand Down
17 changes: 12 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,25 @@ INSTALL_INCLUDE_DIR ?= $(PREFIX)/include

LIBS=fmt sdl ssl openal ui uv mysql

CFLAGS = -Wall -O3 -I src -msse2 -mfpmath=sse -std=c11 -I include -I include/pcre -I include/mikktspace -I include/minimp3 -D LIBHL_EXPORTS
PCRE_FLAGS = -D HAVE_CONFIG_H -D PCRE2_CODE_UNIT_WIDTH=16

CFLAGS = -Wall -O3 -I src -msse2 -mfpmath=sse -std=c11 -I include -I include/pcre -I include/mikktspace -I include/minimp3 -D LIBHL_EXPORTS ${PCRE_FLAGS}
LFLAGS = -L. -lhl
EXTRA_LFLAGS ?=
LIBFLAGS =
HLFLAGS = -ldl
LIBEXT = so
LIBTURBOJPEG = -lturbojpeg

PCRE = include/pcre/pcre_chartables.o include/pcre/pcre_compile.o include/pcre/pcre_dfa_exec.o \
include/pcre/pcre_exec.o include/pcre/pcre_fullinfo.o include/pcre/pcre_globals.o \
include/pcre/pcre_newline.o include/pcre/pcre_string_utils.o include/pcre/pcre_tables.o include/pcre/pcre_xclass.o \
include/pcre/pcre16_ord2utf16.o include/pcre/pcre16_valid_utf16.o include/pcre/pcre_ucd.o
PCRE = include/pcre/pcre2_auto_possess.o include/pcre/pcre2_chartables.o include/pcre/pcre2_compile.o \
include/pcre/pcre2_config.o include/pcre/pcre2_context.o include/pcre/pcre2_convert.o \
include/pcre/pcre2_dfa_match.o include/pcre/pcre2_error.o include/pcre/pcre2_extuni.o \
include/pcre/pcre2_find_bracket.o include/pcre/pcre2_jit_compile.o include/pcre/pcre2_maketables.o \
include/pcre/pcre2_match_data.o include/pcre/pcre2_match.o include/pcre/pcre2_newline.o \
include/pcre/pcre2_ord2utf.o include/pcre/pcre2_pattern_info.o include/pcre/pcre2_script_run.o \
include/pcre/pcre2_serialize.o include/pcre/pcre2_string_utils.o include/pcre/pcre2_study.o \
include/pcre/pcre2_substitute.o include/pcre/pcre2_substring.o include/pcre/pcre2_tables.o \
include/pcre/pcre2_ucd.o include/pcre/pcre2_valid_utf.o include/pcre/pcre2_xclass.o

RUNTIME = src/gc.o

Expand Down
63 changes: 39 additions & 24 deletions libhl.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
</PrecompiledHeader>
<WarningLevel>EnableAllWarnings</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBHL_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBHL_EXPORTS;HAVE_CONFIG_H;PCRE2_CODE_UNIT_WIDTH=16;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalOptions>/wd4054 /wd4456 /wd4702 /wd4100 /wd4457 /wd4820 %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
Expand All @@ -180,7 +180,7 @@
</PrecompiledHeader>
<WarningLevel>EnableAllWarnings</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_DEBUG;_WINDOWS;_USRDLL;LIBHL_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;_WINDOWS;_USRDLL;LIBHL_EXPORTS;HAVE_CONFIG_H;PCRE2_CODE_UNIT_WIDTH=16;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalOptions>/wd4054 /wd4456 /wd4702 /wd4100 /wd4457 /wd4820 %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
Expand All @@ -199,7 +199,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBHL_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBHL_EXPORTS;HAVE_CONFIG_H;PCRE2_CODE_UNIT_WIDTH=16;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalOptions>/wd4054 /wd4456 /wd4702 /wd4100 /wd4457 /wd4820 %(AdditionalOptions)</AdditionalOptions>
<BufferSecurityCheck>false</BufferSecurityCheck>
</ClCompile>
Expand All @@ -219,7 +219,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBHL_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBHL_EXPORTS;HAVE_CONFIG_H;PCRE2_CODE_UNIT_WIDTH=16;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalOptions>/wd4054 /wd4456 /wd4702 /wd4100 /wd4457 /wd4820 %(AdditionalOptions)</AdditionalOptions>
<BufferSecurityCheck>false</BufferSecurityCheck>
</ClCompile>
Expand All @@ -239,7 +239,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBHL_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBHL_EXPORTS;HAVE_CONFIG_H;PCRE2_CODE_UNIT_WIDTH=16;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalOptions>/wd4054 /wd4456 /wd4702 /wd4100 /wd4457 /wd4820 %(AdditionalOptions)</AdditionalOptions>
<BufferSecurityCheck>false</BufferSecurityCheck>
</ClCompile>
Expand All @@ -259,7 +259,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;LIBHL_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;LIBHL_EXPORTS;HAVE_CONFIG_H;PCRE2_CODE_UNIT_WIDTH=16;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalOptions>/wd4054 /wd4456 /wd4702 /wd4100 /wd4457 /wd4820 %(AdditionalOptions)</AdditionalOptions>
<BufferSecurityCheck>false</BufferSecurityCheck>
</ClCompile>
Expand All @@ -279,7 +279,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;LIBHL_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;LIBHL_EXPORTS;HAVE_CONFIG_H;PCRE2_CODE_UNIT_WIDTH=16;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalOptions>/wd4054 /wd4456 /wd4702 /wd4100 /wd4457 /wd4820 %(AdditionalOptions)</AdditionalOptions>
<BufferSecurityCheck>false</BufferSecurityCheck>
</ClCompile>
Expand All @@ -299,7 +299,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;LIBHL_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;LIBHL_EXPORTS;HAVE_CONFIG_H;PCRE2_CODE_UNIT_WIDTH=16;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalOptions>/wd4054 /wd4456 /wd4702 /wd4100 /wd4457 /wd4820 %(AdditionalOptions)</AdditionalOptions>
<BufferSecurityCheck>false</BufferSecurityCheck>
</ClCompile>
Expand All @@ -312,19 +312,33 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="include\pcre\pcre16_ord2utf16.c" />
<ClCompile Include="include\pcre\pcre16_valid_utf16.c" />
<ClCompile Include="include\pcre\pcre_chartables.c" />
<ClCompile Include="include\pcre\pcre_compile.c" />
<ClCompile Include="include\pcre\pcre_dfa_exec.c" />
<ClCompile Include="include\pcre\pcre_exec.c" />
<ClCompile Include="include\pcre\pcre_fullinfo.c" />
<ClCompile Include="include\pcre\pcre_globals.c" />
<ClCompile Include="include\pcre\pcre_newline.c" />
<ClCompile Include="include\pcre\pcre_string_utils.c" />
<ClCompile Include="include\pcre\pcre_tables.c" />
<ClCompile Include="include\pcre\pcre_ucd.c" />
<ClCompile Include="include\pcre\pcre_xclass.c" />
<ClCompile Include="include\pcre\pcre2_auto_possess.c" />
<ClCompile Include="include\pcre\pcre2_chartables.c" />
<ClCompile Include="include\pcre\pcre2_compile.c" />
<ClCompile Include="include\pcre\pcre2_config.c" />
<ClCompile Include="include\pcre\pcre2_context.c" />
<ClCompile Include="include\pcre\pcre2_convert.c" />
<ClCompile Include="include\pcre\pcre2_dfa_match.c" />
<ClCompile Include="include\pcre\pcre2_error.c" />
<ClCompile Include="include\pcre\pcre2_extuni.c" />
<ClCompile Include="include\pcre\pcre2_find_bracket.c" />
<ClCompile Include="include\pcre\pcre2_jit_compile.c" />
<ClCompile Include="include\pcre\pcre2_maketables.c" />
<ClCompile Include="include\pcre\pcre2_match.c" />
<ClCompile Include="include\pcre\pcre2_match_data.c" />
<ClCompile Include="include\pcre\pcre2_newline.c" />
<ClCompile Include="include\pcre\pcre2_ord2utf.c" />
<ClCompile Include="include\pcre\pcre2_pattern_info.c" />
<ClCompile Include="include\pcre\pcre2_script_run.c" />
<ClCompile Include="include\pcre\pcre2_serialize.c" />
<ClCompile Include="include\pcre\pcre2_string_utils.c" />
<ClCompile Include="include\pcre\pcre2_study.c" />
<ClCompile Include="include\pcre\pcre2_substitute.c" />
<ClCompile Include="include\pcre\pcre2_substring.c" />
<ClCompile Include="include\pcre\pcre2_tables.c" />
<ClCompile Include="include\pcre\pcre2_ucd.c" />
<ClCompile Include="include\pcre\pcre2_valid_utf.c" />
<ClCompile Include="include\pcre\pcre2_xclass.c" />
<ClCompile Include="src\gc.c" />
<ClCompile Include="src\std\array.c" />
<ClCompile Include="src\std\buffer.c" />
Expand All @@ -351,9 +365,10 @@
</ItemGroup>
<ItemGroup>
<ClInclude Include="include\pcre\config.h" />
<ClInclude Include="include\pcre\pcre.h" />
<ClInclude Include="include\pcre\pcre_internal.h" />
<ClInclude Include="include\pcre\ucp.h" />
<ClInclude Include="include\pcre\pcre2.h" />
<ClInclude Include="include\pcre\pcre2_internal.h" />
<ClInclude Include="include\pcre\pcre2_intmodedep.h" />
<ClInclude Include="include\pcre\pcre2_ucp.h" />
<ClInclude Include="src\hl.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
Expand Down
125 changes: 85 additions & 40 deletions libhl.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,6 @@
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="include\pcre\pcre_chartables.c">
<Filter>pcre</Filter>
</ClCompile>
<ClCompile Include="include\pcre\pcre_compile.c">
<Filter>pcre</Filter>
</ClCompile>
<ClCompile Include="include\pcre\pcre_dfa_exec.c">
<Filter>pcre</Filter>
</ClCompile>
<ClCompile Include="include\pcre\pcre_exec.c">
<Filter>pcre</Filter>
</ClCompile>
<ClCompile Include="include\pcre\pcre_fullinfo.c">
<Filter>pcre</Filter>
</ClCompile>
<ClCompile Include="include\pcre\pcre_globals.c">
<Filter>pcre</Filter>
</ClCompile>
<ClCompile Include="include\pcre\pcre_newline.c">
<Filter>pcre</Filter>
</ClCompile>
<ClCompile Include="include\pcre\pcre_string_utils.c">
<Filter>pcre</Filter>
</ClCompile>
<ClCompile Include="include\pcre\pcre_tables.c">
<Filter>pcre</Filter>
</ClCompile>
<ClCompile Include="include\pcre\pcre_xclass.c">
<Filter>pcre</Filter>
</ClCompile>
<ClCompile Include="src\std\array.c">
<Filter>std</Filter>
</ClCompile>
Expand Down Expand Up @@ -102,33 +72,108 @@
<ClCompile Include="src\std\debug.c">
<Filter>std</Filter>
</ClCompile>
<ClCompile Include="include\pcre\pcre_ucd.c">
<ClCompile Include="src\std\track.c">
<Filter>std</Filter>
</ClCompile>
<ClCompile Include="src\gc.c" />
<ClCompile Include="include\pcre\pcre2_auto_possess.c">
<Filter>pcre</Filter>
</ClCompile>
<ClCompile Include="include\pcre\pcre16_valid_utf16.c">
<ClCompile Include="include\pcre\pcre2_chartables.c">
<Filter>pcre</Filter>
</ClCompile>
<ClCompile Include="include\pcre\pcre16_ord2utf16.c">
<ClCompile Include="include\pcre\pcre2_compile.c">
<Filter>pcre</Filter>
</ClCompile>
<ClCompile Include="src\std\track.c">
<Filter>std</Filter>
<ClCompile Include="include\pcre\pcre2_config.c">
<Filter>pcre</Filter>
</ClCompile>
<ClCompile Include="include\pcre\pcre2_context.c">
<Filter>pcre</Filter>
</ClCompile>
<ClCompile Include="include\pcre\pcre2_convert.c">
<Filter>pcre</Filter>
</ClCompile>
<ClCompile Include="include\pcre\pcre2_dfa_match.c">
<Filter>pcre</Filter>
</ClCompile>
<ClCompile Include="include\pcre\pcre2_error.c">
<Filter>pcre</Filter>
</ClCompile>
<ClCompile Include="include\pcre\pcre2_extuni.c">
<Filter>pcre</Filter>
</ClCompile>
<ClCompile Include="include\pcre\pcre2_find_bracket.c">
<Filter>pcre</Filter>
</ClCompile>
<ClCompile Include="include\pcre\pcre2_jit_compile.c">
<Filter>pcre</Filter>
</ClCompile>
<ClCompile Include="include\pcre\pcre2_maketables.c">
<Filter>pcre</Filter>
</ClCompile>
<ClCompile Include="include\pcre\pcre2_match.c">
<Filter>pcre</Filter>
</ClCompile>
<ClCompile Include="include\pcre\pcre2_match_data.c">
<Filter>pcre</Filter>
</ClCompile>
<ClCompile Include="include\pcre\pcre2_newline.c">
<Filter>pcre</Filter>
</ClCompile>
<ClCompile Include="include\pcre\pcre2_ord2utf.c">
<Filter>pcre</Filter>
</ClCompile>
<ClCompile Include="include\pcre\pcre2_pattern_info.c">
<Filter>pcre</Filter>
</ClCompile>
<ClCompile Include="include\pcre\pcre2_script_run.c">
<Filter>pcre</Filter>
</ClCompile>
<ClCompile Include="include\pcre\pcre2_serialize.c">
<Filter>pcre</Filter>
</ClCompile>
<ClCompile Include="include\pcre\pcre2_string_utils.c">
<Filter>pcre</Filter>
</ClCompile>
<ClCompile Include="include\pcre\pcre2_study.c">
<Filter>pcre</Filter>
</ClCompile>
<ClCompile Include="include\pcre\pcre2_substitute.c">
<Filter>pcre</Filter>
</ClCompile>
<ClCompile Include="include\pcre\pcre2_substring.c">
<Filter>pcre</Filter>
</ClCompile>
<ClCompile Include="include\pcre\pcre2_tables.c">
<Filter>pcre</Filter>
</ClCompile>
<ClCompile Include="include\pcre\pcre2_ucd.c">
<Filter>pcre</Filter>
</ClCompile>
<ClCompile Include="include\pcre\pcre2_valid_utf.c">
<Filter>pcre</Filter>
</ClCompile>
<ClCompile Include="include\pcre\pcre2_xclass.c">
<Filter>pcre</Filter>
</ClCompile>
<ClCompile Include="src\gc.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\hl.h" />
<ClInclude Include="include\pcre\config.h">
<Filter>pcre</Filter>
</ClInclude>
<ClInclude Include="include\pcre\pcre.h">
<ClInclude Include="include\pcre\pcre2.h">
<Filter>pcre</Filter>
</ClInclude>
<ClInclude Include="include\pcre\pcre_internal.h">
<ClInclude Include="include\pcre\pcre2_internal.h">
<Filter>pcre</Filter>
</ClInclude>
<ClInclude Include="include\pcre\ucp.h">
<ClInclude Include="include\pcre\pcre2_intmodedep.h">
<Filter>pcre</Filter>
</ClInclude>
<ClInclude Include="include\pcre\pcre2_ucp.h">
<Filter>pcre</Filter>
</ClInclude>
<ClInclude Include="src\hl.h" />
</ItemGroup>
</Project>

0 comments on commit 2e98a47

Please sign in to comment.