Always build ctpp2c for the host and static.

We are using `ctpp2c` when building kiwix-lib to compile embedded resources.

As `ctpp2c` will be used in the host machine, it always need to be
compiled for the host (native).
But we still want tho ctpp2 library compiled for the target platform.
As we don't want handle the conflict between two dynamic lib with the same
name but for two different platforms, we build ctpp2c statically.
This commit is contained in:
Matthieu Gautier
2017-07-12 14:30:55 +02:00
parent bebec0702c
commit 1fda646708
2 changed files with 37 additions and 2 deletions

View File

@ -0,0 +1,13 @@
diff -u ctpp2-2.8.3/CMakeLists.txt ctpp2-2.8.3-static/CMakeLists.txt
--- ctpp2-2.8.3/CMakeLists.txt 2017-07-12 11:53:28.656535071 +0200
+++ ctpp2-2.8.3-static/CMakeLists.txt 2017-07-12 11:52:15.358692988 +0200
@@ -464,7 +464,8 @@
# CTPP Compiler
ADD_EXECUTABLE(ctpp2c tests/CTPP2Compiler.cpp)
-TARGET_LINK_LIBRARIES(ctpp2c ctpp2)
+TARGET_LINK_LIBRARIES(ctpp2c ctpp2-static)
+TARGET_LINK_LIBRARIES(ctpp2c "-static")
# CTPP2 Interpreter
ADD_EXECUTABLE(ctpp2i tests/CTPP2Interpreter.cpp)