Skip to content

Commit 43dc98d

Browse files
committed
Remove need for config.h file, set HAVE_LUA(JIT) directly
1 parent ce06296 commit 43dc98d

12 files changed

Lines changed: 35 additions & 18 deletions

File tree

.github/actions/ubuntu-prerequisites/action.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ runs:
1818
libboost-system-dev \
1919
libbz2-dev \
2020
libexpat1-dev \
21-
libluajit-5.1-dev \
2221
libpq-dev \
2322
libproj-dev \
2423
pandoc \
@@ -31,13 +30,20 @@ runs:
3130
if [ "$CC" = clang-8 ]; then sudo apt-get install -yq --no-install-suggests --no-install-recommends clang-8; fi
3231
shell: bash
3332

34-
- name: Install lua
33+
- name: Install Lua
3534
run: |
3635
if [ -n "${LUA_VERSION}" ]; then
3736
sudo apt-get install -yq --no-install-suggests --no-install-recommends liblua${LUA_VERSION}-dev lua${LUA_VERSION}
3837
fi
3938
shell: bash
4039

40+
- name: Install LuaJIT
41+
run: |
42+
if [ "${LUAJIT_OPTION}" = "ON" ]; then
43+
sudo apt-get install -yq --no-install-suggests --no-install-recommends libluajit-5.1-dev
44+
fi
45+
shell: bash
46+
4147
- name: Adapt postgresql configuration
4248
run: |
4349
echo 'fsync = off' | sudo tee /etc/postgresql/${POSTGRESQL_VERSION}/main/conf.d/local.conf

.github/workflows/ci.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,22 @@ jobs:
216216
- uses: ./.github/actions/ubuntu-prerequisites
217217
- uses: ./.github/actions/build-and-test
218218

219+
ubuntu20-pg13-gcc10-release-nolua:
220+
runs-on: ubuntu-20.04
221+
222+
env:
223+
CC: gcc-10
224+
CXX: g++-10
225+
POSTGRESQL_VERSION: 13
226+
POSTGIS_VERSION: 2.5
227+
CPP_VERSION: 17
228+
BUILD_TYPE: Release
229+
230+
steps:
231+
- uses: actions/checkout@v2
232+
- uses: ./.github/actions/ubuntu-prerequisites
233+
- uses: ./.github/actions/build-and-test
234+
219235
windows:
220236
strategy:
221237
fail-fast: false

CMakeLists.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,15 +187,19 @@ include_directories(SYSTEM ${OSMIUM_INCLUDE_DIRS} ${PROTOZERO_INCLUDE_DIR} ${FMT
187187
188188
if (WITH_LUA)
189189
if (WITH_LUAJIT)
190+
message(STATUS "Building with LuaJIT support")
190191
find_package(LuaJIT REQUIRED)
191192
include_directories(SYSTEM ${LUAJIT_INCLUDE_DIR})
192-
set(HAVE_LUAJIT 1)
193+
add_definitions(-DHAVE_LUAJIT=1)
193194
else()
195+
message(STATUS "Building with Lua support")
194196
find_package(Lua REQUIRED)
195197
include_directories(SYSTEM ${LUA_INCLUDE_DIR})
196198
endif()
197-
set(HAVE_LUA 1)
199+
add_definitions(-DHAVE_LUA=1)
198200
find_program(LUA_EXE lua)
201+
else()
202+
message(STATUS "Building without Lua support")
199203
endif()
200204
201205
find_package(Boost 1.50 REQUIRED COMPONENTS system filesystem)
@@ -272,8 +276,6 @@ message(STATUS "Libraries used to build: ${LIBS}")
272276
# Build the library and executable file
273277
#############################################################
274278
275-
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
276-
277279
add_subdirectory(src)
278280
279281
add_executable(osm2pgsql src/osm2pgsql.cpp)

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ always be used for code blocks, even one-liners.
3838
Names should use underscores, not camel case, with class/struct names ending in `_t`.
3939
Template parameters must use all upper case.
4040

41-
Headers should be included in the order `config.h`, C++ standard library headers,
41+
Headers should be included in the order C++ standard library headers,
4242
C library headers, Boost headers, and last osm2pgsql files.
4343

4444
There is a .clang-format configuration available and all code must be run through

cmake/config.h.in

Lines changed: 0 additions & 2 deletions
This file was deleted.

src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ target_sources(osm2pgsql_lib PRIVATE
4040
wkb.cpp
4141
)
4242

43-
if (LUA_FOUND OR LUAJIT_FOUND)
43+
if (WITH_LUA)
4444
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS
4545
"${CMAKE_CURRENT_SOURCE_DIR}/init.lua")
4646
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/init.lua" LUA_INIT_CODE)

src/lua-utils.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
* For a full list of authors see the git log.
88
*/
99

10-
#include "config.h"
1110
#include "lua-utils.hpp"
1211
#include "format.hpp"
1312

src/options.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
* For a full list of authors see the git log.
88
*/
99

10-
#include "config.h"
1110
#include "format.hpp"
1211
#include "logging.hpp"
1312
#include "options.hpp"

src/output.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
* For a full list of authors see the git log.
88
*/
99

10-
#include "config.h"
11-
1210
#include "db-copy.hpp"
1311
#include "format.hpp"
1412
#include "output-gazetteer.hpp"

src/tagtransform.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
* For a full list of authors see the git log.
88
*/
99

10-
#include "config.h"
1110
#include "logging.hpp"
1211
#include "options.hpp"
1312
#include "tagtransform-c.hpp"

0 commit comments

Comments
 (0)