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
82e3dfb7
Commit
82e3dfb7
authored
11 years ago
by
Roman Tsisyk
Browse files
Options
Downloads
Patches
Plain Diff
Support for cross-compilation in luajit.cmake
parent
586e7424
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
+20
-7
20 additions, 7 deletions
cmake/luajit.cmake
with
20 additions
and
7 deletions
cmake/luajit.cmake
+
20
−
7
View file @
82e3dfb7
...
...
@@ -130,7 +130,7 @@ message (STATUS "Use LuaJIT library: ${LUAJIT_LIB}")
macro
(
luajit_build
)
set
(
luajit_buildoptions BUILDMODE=static
)
set
(
luajit_copt
${
CMAKE_C_FLAGS
}
)
set
(
luajit_copt
""
)
if
(
${
CMAKE_BUILD_TYPE
}
STREQUAL
"Debug"
)
set
(
luajit_buildoptions
${
luajit_buildoptions
}
CCDEBUG=
${
CC_DEBUG_OPT
}
)
set
(
luajit_copt
${
luajit_copt
}
-O1
)
...
...
@@ -139,20 +139,33 @@ macro(luajit_build)
set
(
luajit_copt
${
luajit_copt
}
-O2
)
endif
()
set
(
luajit_copt
${
luajit_copt
}
-I
${
PROJECT_SOURCE_DIR
}
/libobjc
)
set
(
luajit_cc
${
CMAKE_C_COMPILER
}
)
if
(
NOT luajit_cc
)
message
(
FATAL_ERROR
"LuaJIT will not compile with default C compiler (cc)"
)
set
(
luajit_target_cc
"
${
CMAKE_C_COMPILER
}
${
CMAKE_C_FLAGS
}
"
)
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
}
)
else
()
# Crosscompile mode - use a host CC compiler for building host utils.
# Since CMake does not support cross compilation properly
# we have to use system CC here.
set
(
luajit_host_cc
"cc"
)
endif
()
if
(
${
CMAKE_HOST_SYSTEM_PROCESSOR
}
STREQUAL
"x86_64"
AND
${
CMAKE_SIZEOF_VOID_P
}
EQUAL 4
)
# The host compiler must have same pointer size as the target compiler.
set
(
luajit_host_cc
"
${
luajit_host_cc
}
-m32"
)
endif
()
set
(
luajit_ldflags
"
${
CMAKE_SHARED_LINKER_FLAGS
}
"
)
separate_arguments
(
luajit_copt
)
separate_arguments
(
luajit_ldflags
)
set
(
luajit_buildoptions
${
luajit_buildoptions
}
CC=
"
${
luajit_cc
}
"
TARGET_CC=
"
${
luajit_cc
}
"
CCOPT=
"
${
luajit_copt
}
"
)
separate_arguments
(
luajit_host_cc
)
separate_arguments
(
luajit_target_cc
)
set
(
luajit_buildoptions
${
luajit_buildoptions
}
HOST_CC=
"
${
luajit_host_cc
}
"
TARGET_CC=
"
${
luajit_target_cc
}
"
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
COMMAND $
(
MAKE
)
clean
COMMAND $
(
MAKE
)
-C src
${
luajit_buildoptions
}
COMMAND $
(
MAKE
)
-C src
${
luajit_buildoptions
}
libluajit.a
DEPENDS
${
CMAKE_SOURCE_DIR
}
/CMakeCache.txt
)
else
()
...
...
@@ -163,7 +176,7 @@ macro(luajit_build)
WORKING_DIRECTORY
${
PROJECT_BINARY_DIR
}
/third_party/luajit
COMMAND cp -r
${
PROJECT_SOURCE_DIR
}
/third_party/luajit/* .
COMMAND $
(
MAKE
)
clean
COMMAND $
(
MAKE
)
-C src
${
luajit_buildoptions
}
COMMAND $
(
MAKE
)
-C src
${
luajit_buildoptions
}
libluajit.a
DEPENDS
${
PROJECT_BINARY_DIR
}
/CMakeCache.txt
${
PROJECT_BINARY_DIR
}
/third_party/luajit
)
endif
()
...
...
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