Skip to content

Commit

Permalink
修复编译错误
Browse files Browse the repository at this point in the history
  • Loading branch information
xiyoo0812 committed Apr 12, 2024
1 parent 7565dfa commit bd5309f
Show file tree
Hide file tree
Showing 10 changed files with 77 additions and 15 deletions.
2 changes: 1 addition & 1 deletion extend/ljson/ljson.lmak
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ TARGET_NAME = "ljson"
----工程类型: static/dynamic/exe
PROJECT_TYPE = "dynamic"

EX_FLAGS = {
FLAGS = {
"Wno-implicit-fallthrough"
}

Expand Down
27 changes: 24 additions & 3 deletions extend/lmake/share.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ STDCPP = "c++17"
ENABLE = true

--需要的FLAGS
FLAGS = {
BASE_FLAGS = {
"Wsign-compare",
"Wno-sign-compare",
"Wno-unused-variable",
Expand All @@ -21,9 +21,17 @@ FLAGS = {
"Wno-unknown-pragmas"
}

--扩展的FLAGS
EX_FLAGS = {
--FLAGS
FLAGS = {

}

LINUX_FLAGS = {

}

DARWIN_FLAGS = {

}

--需要的include目录
Expand Down Expand Up @@ -124,6 +132,19 @@ LINUX_LIBS = {
DARWIN_LIBS = {
}

--LDFLAGS
LDFLAGS = {

}

LINUX_LDFLAGS = {

}

DARWIN_LDFLAGS = {

}

--WINDOWS预编译命令
--格式: { cmd, args }
--{ "copy /y", "bin/libcurl-x64.dll $(SolutionDir)bin" }
Expand Down
33 changes: 32 additions & 1 deletion extend/lmake/tmpl/make.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,26 @@ all : pre_build target post_build
MYCFLAGS =

#需要定义的FLAG
{{% for _, flag in ipairs(BASE_FLAGS) do %}}
MYCFLAGS += -{{%= flag %}}
{{% end %}}
{{% for _, flag in ipairs(FLAGS) do %}}
MYCFLAGS += -{{%= flag %}}
{{% end %}}
{{% for _, flag in ipairs(EX_FLAGS) do %}}
{{% if #LINUX_FLAGS > 0 then %}}
ifeq ($(UNAME_S), Linux)
{{% for _, flag in ipairs(LINUX_FLAGS) do %}}
MYCFLAGS += -{{%= flag %}}
{{% end %}}
endif
{{% end %}}
{{% if #DARWIN_FLAGS > 0 then %}}
ifeq ($(UNAME_S), Darwin)
{{% for _, flag in ipairs(DARWIN_FLAGS) do %}}
MYCFLAGS += -{{%= flag %}}
{{% end %}}
endif
{{% end %}}

{{% if STDC then %}}
#c标准库版本
Expand Down Expand Up @@ -76,6 +90,23 @@ endif

#LDFLAGS
LDFLAGS =
{{% for _, flag in ipairs(LDFLAGS) do %}}
LDFLAGS += {{%= flag %}}
{{% end %}}
{{% if #LINUX_LDFLAGS > 0 then %}}
ifeq ($(UNAME_S), Linux)
{{% for _, flag in ipairs(LINUX_LDFLAGS) do %}}
LDFLAGS += {{%= flag %}}
{{% end %}}
endif
{{% end %}}
{{% if #DARWIN_LDFLAGS > 0 then %}}
ifeq ($(UNAME_S), Darwin)
{{% for _, flag in ipairs(DARWIN_LDFLAGS) do %}}
LDFLAGS += {{%= flag %}}
{{% end %}}
endif
{{% end %}}

{{% if #LIBRARY_DIR > 0 then %}}
#需要附加link库目录
Expand Down
2 changes: 1 addition & 1 deletion extend/lmdb/lmdb.lmak
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ TARGET_NAME = "lmdb"
----工程类型: static/dynamic/exe
PROJECT_TYPE = "dynamic"

EX_FLAGS = {
FLAGS = {
"Wno-implicit-fallthrough"
}

Expand Down
2 changes: 1 addition & 1 deletion extend/lsqlite/lsqlite.lmak
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ TARGET_NAME = "lsqlite"
----工程类型: static/dynamic/exe
PROJECT_TYPE = "dynamic"

EX_FLAGS = {
FLAGS = {
"Wno-implicit-fallthrough"
}

Expand Down
11 changes: 7 additions & 4 deletions extend/lssl/lssl.lmak
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ TARGET_NAME = "lssl"
----工程类型: static/dynamic/exe
PROJECT_TYPE = "dynamic"

--目标文件前缀
LIB_PREFIX = 1

EX_FLAGS = {
FLAGS = {
"Wno-implicit-fallthrough"
}

Expand All @@ -27,6 +24,12 @@ LINUX_DEFINES = {

--DARWIN需要定义的选项
DARWIN_DEFINES = {
"WOLFSSL_APPLE_NATIVE_CERT_VALIDATION"
}

DARWIN_LDFLAGS = {
"-framework CoreFoundation",
"-framework Security"
}

--WINDOWS需要定义的选项
Expand Down
9 changes: 8 additions & 1 deletion extend/lssl/lssl.mak
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,16 @@ MYCFLAGS += -DWOLFSSL_SRTP
MYCFLAGS += -DWOLFSSL_NO_SOCK
MYCFLAGS += -DWOLFSSL_USER_IO
MYCFLAGS += -DWOLFSSL_USER_SETTINGS
ifeq ($(UNAME_S), Darwin)
MYCFLAGS += -DWOLFSSL_APPLE_NATIVE_CERT_VALIDATION
endif

#LDFLAGS
LDFLAGS =
ifeq ($(UNAME_S), Darwin)
LDFLAGS += -framework CoreFoundation
LDFLAGS += -framework Security
endif


#源文件路径
Expand Down Expand Up @@ -97,7 +104,7 @@ endif
INT_DIR = $(SOLUTION_DIR)temp/$(PROJECT_NAME)

#目标文件前缀,定义则.so和.a加lib前缀,否则不加
PROJECT_PREFIX = lib
PROJECT_PREFIX =

#目标定义
MYCFLAGS += -fPIC
Expand Down
2 changes: 1 addition & 1 deletion extend/luaxlsx/luaxlsx.lmak
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ TARGET_NAME = "luaxlsx"
----工程类型: static/dynamic/exe
PROJECT_TYPE = "dynamic"

EX_FLAGS = {
FLAGS = {
"Wno-implicit-fallthrough"
}

Expand Down
2 changes: 1 addition & 1 deletion extend/luaxlsx/miniz.lmak
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ PROJECT_TYPE = "dynamic"
--目标文件前缀
LIB_PREFIX = 1

EX_FLAGS = {
FLAGS = {
"Wno-implicit-fallthrough"
}

Expand Down
2 changes: 1 addition & 1 deletion extend/lunqlite/lunqlite.lmak
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ TARGET_NAME = "lunqlite"
----工程类型: static/dynamic/exe
PROJECT_TYPE = "dynamic"

EX_FLAGS = {
FLAGS = {
"Wno-implicit-fallthrough"
}

Expand Down

0 comments on commit bd5309f

Please sign in to comment.