Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tarantool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
tarantool
Commits
f5a1b197
Commit
f5a1b197
authored
9 years ago
by
Konstantin Osipov
Browse files
Options
Downloads
Patches
Plain Diff
Revert "Fix luajit build issues on OSX + refactoring"
This reverts commit
615f0985
.
parent
0a747304
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cmake/luajit.cmake
+22
-41
22 additions, 41 deletions
cmake/luajit.cmake
with
22 additions
and
41 deletions
cmake/luajit.cmake
+
22
−
41
View file @
f5a1b197
...
...
@@ -129,50 +129,27 @@ message (STATUS "Use LuaJIT includes: ${LUAJIT_INCLUDE}")
message
(
STATUS
"Use LuaJIT library:
${
LUAJIT_LIB
}
"
)
macro
(
luajit_build
)
# Cmake rules concerning strings and lists of strings are weird.
# set (foo "1 2 3") defines a string, while
# set (foo 1 2 3) defines a list.
# Use separate_arguments() to turn a string into a list (splits at ws).
# It appears that variable expansion rules are context-dependent.
# With the current arrangement add_custom_command()
# does the right thing. We can even handle pathnames with
# spaces though a path with an embeded semicolon or a quotation mark
# will most certainly wreak havok.
#
# This stuff is extremely fragile, proceed with caution.
set
(
luajit_cflags
${
CMAKE_C_FLAGS
}
)
separate_arguments
(
luajit_cflags
)
set
(
luajut_ldflags
${
CMAKE_STATIC_LINKER_FLAGS
}
)
separate_arguments
(
luajit_ldflags
)
# Use external unwind on all platforms.
set
(
luajit_xcflags
"-DLUAJIT_UNWIND_EXTERNAL=1"
)
# We are consciously ommiting debug info in RelWithDebugInfo mode
set
(
luajit_buildoptions BUILDMODE=static
)
set
(
luajit_copt
""
)
set
(
luajit_xcflags
""
)
if
(
${
CMAKE_BUILD_TYPE
}
STREQUAL
"Debug"
)
set
(
luajit_ccopt -O0
)
if
(
CC_HAS_GGDB
)
set
(
luajit_ccdebug -g -ggdb
)
else
()
set
(
luajit_ccdebug -g
)
endif
()
set
(
luajit_buildoptions
${
luajit_buildoptions
}
CCDEBUG=
${
CC_DEBUG_OPT
}
)
set
(
luajit_copt
${
luajit_copt
}
-O1
)
set
(
luajit_xcflags
${
luajit_xcflags
}
-DLUA_USE_APICHECK -DLUA_USE_ASSERT
)
else
()
set
(
luajit_cсopt -O2
)
set
(
luajit_ccdbebug
""
)
endif
()
# Pass sysroot settings on OSX
if
(
NOT
"
${
CMAKE_OSX_SYSROOT
}
"
STREQUAL
""
)
set
(
luajit_cflags
${
luajit_cflags
}
${
CMAKE_C_SYSROOT_FLAG
}
${
CMAKE_OSX_SYSROOT
}
)
set
(
luajit_ldflags
${
luajit_ldlags
}
${
CMAKE_C_SYSROOT_FLAG
}
${
CMAKE_OSX_SYSROOT
}
)
set
(
luajit_copt
${
luajit_copt
}
-O2
)
endif
()
if
(
ENABLE_VALGRIND
)
set
(
luajit_xcflags
${
luajit_xcflags
}
-DLUAJIT_USE_VALGRIND -DLUAJIT_USE_SYSMALLOC
)
endif
()
set
(
luajit_target_cc
${
CMAKE_C_COMPILER
}
${
CMAKE_C_COMPILER_ARG1
}
)
set
(
luajit_target_cc
"
${
CMAKE_C_COMPILER
}
${
CMAKE_C_COMPILER_ARG1
}
${
CMAKE_C_FLAGS
}
"
)
# Use external unwind on all platforms.
set
(
luajit_target_cc
"
${
luajit_target_cc
}
-DLUAJIT_UNWIND_EXTERNAL=1"
)
if
(
${
CMAKE_SYSTEM_PROCESSOR
}
STREQUAL
${
CMAKE_HOST_SYSTEM_PROCESSOR
}
)
# Regular mode - use CMake compiler for building host utils.
set
(
luajit_host_cc
${
CMAKE_C_COMPILER
}
${
CMAKE_C_COMPILER_ARG1
}
)
set
(
luajit_host_cc
${
CMAKE_C_COMPILER
}
${
CMAKE_C_COMPILER_ARG1
}
${
CMAKE_C_FLAGS
}
)
else
()
# Crosscompile mode - use a host CC compiler for building host utils.
# Since CMake does not support cross compilation properly
...
...
@@ -184,16 +161,20 @@ macro(luajit_build)
# The host compiler must have same pointer size as the target compiler.
set
(
luajit_host_cc
"
${
luajit_host_cc
}
-m32"
)
endif
()
set
(
luajit_buildoptions
BUILDMODE=static
CC=
"
${
luajit_host_cc
}
"
CFLAGS=
"
${
luajit_cflags
}
"
LDFLAGS=
"
${
luajit_ldflags
}
"
CCOPT=
"
${
luajit_ccopt
}
"
CCDEBUG=
"
${
luajit_ccdebug
}
"
set
(
luajit_ldflags
"
${
CMAKE_SHARED_LINKER_FLAGS
}
"
)
separate_arguments
(
luajit_copt
)
separate_arguments
(
luajit_ldflags
)
separate_arguments
(
luajit_host_cc
)
separate_arguments
(
luajit_target_cc
)
set
(
luajit_buildoptions
${
luajit_buildoptions
}
CFLAGS=
""
CXXFLAGS=
""
XCFLAGS=
"
${
luajit_xcflags
}
"
CC=
"
${
luajit_host_cc
}
"
HOST_CC=
"
${
luajit_host_cc
}
"
TARGET_CC=
"
${
luajit_target_cc
}
"
Q=''
)
CCOPT=
"
${
luajit_copt
}
"
)
set
(
luajit_buildoptions
${
luajit_buildoptions
}
Q='' LDFLAGS=
"
${
luajit_ldflags
}
"
)
if
(
${
PROJECT_BINARY_DIR
}
STREQUAL
${
PROJECT_SOURCE_DIR
}
)
add_custom_command
(
OUTPUT
${
PROJECT_BINARY_DIR
}
/third_party/luajit/src/libluajit.a
WORKING_DIRECTORY
${
PROJECT_BINARY_DIR
}
/third_party/luajit
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment