mirror of
https://github.com/znc/znc.git
synced 2026-08-07 17:33:34 +02:00
Rerun SWIG in CMake build when headers change.
This commit is contained in:
@@ -54,6 +54,7 @@ if(SWIG_FOUND)
|
||||
-o "${CMAKE_CURRENT_BINARY_DIR}/modperl_biglib.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/modperl.i"
|
||||
DEPENDS "modperl.i"
|
||||
IMPLICIT_DEPENDS CXX "${CMAKE_CURRENT_SOURCE_DIR}/modperl.i"
|
||||
VERBATIM)
|
||||
else()
|
||||
add_custom_command(
|
||||
@@ -64,12 +65,14 @@ else()
|
||||
endif()
|
||||
add_custom_target(modperl_functions DEPENDS "perlfunctions.cpp")
|
||||
add_custom_target(modperl_swigruntime DEPENDS "swigperlrun.h")
|
||||
add_custom_target(modperl_swig DEPENDS "modperl_biglib.cpp" "ZNC.pm")
|
||||
|
||||
execute_process(COMMAND "${PERL_EXECUTABLE}"
|
||||
-MConfig "-eprint $Config::Config{dlext}"
|
||||
OUTPUT_VARIABLE perl_ext)
|
||||
|
||||
znc_add_library(modperl_lib MODULE modperl_biglib.cpp)
|
||||
add_dependencies(modperl_lib modperl_swig)
|
||||
target_include_directories(modperl_lib PRIVATE
|
||||
"${PROJECT_BINARY_DIR}/include"
|
||||
"${PROJECT_SOURCE_DIR}/include"
|
||||
|
||||
@@ -50,6 +50,7 @@ if(SWIG_FOUND)
|
||||
-o "${CMAKE_CURRENT_BINARY_DIR}/modpython_biglib.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/modpython.i"
|
||||
DEPENDS "modpython.i"
|
||||
IMPLICIT_DEPENDS CXX "${CMAKE_CURRENT_SOURCE_DIR}/modpython.i"
|
||||
VERBATIM)
|
||||
else()
|
||||
add_custom_command(
|
||||
@@ -60,8 +61,10 @@ else()
|
||||
endif()
|
||||
add_custom_target(modpython_functions DEPENDS "pyfunctions.cpp")
|
||||
add_custom_target(modpython_swigruntime DEPENDS "swigpyrun.h")
|
||||
add_custom_target(modpython_swig DEPENDS "modpython_biglib.cpp" "znc_core.py")
|
||||
|
||||
znc_add_library(modpython_lib MODULE modpython_biglib.cpp)
|
||||
add_dependencies(modpython_lib modpython_swig)
|
||||
target_include_directories(modpython_lib PRIVATE
|
||||
"${PROJECT_BINARY_DIR}/include"
|
||||
"${PROJECT_SOURCE_DIR}/include"
|
||||
|
||||
Reference in New Issue
Block a user