[waffle] [PATCH 16/29] cmocka: fix the build for the new version
Emil Velikov
emil.l.velikov at gmail.com
Wed Jan 6 13:27:42 PST 2016
XXX: should we squash this with the previous commit ?
Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
cmake/Modules/WaffleCMocka.cmake | 15 ++++++++++++++-
cmake/Modules/WaffleDefineCompilerFlags.cmake | 2 +-
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/cmake/Modules/WaffleCMocka.cmake b/cmake/Modules/WaffleCMocka.cmake
index 9222645..1e11579 100644
--- a/cmake/Modules/WaffleCMocka.cmake
+++ b/cmake/Modules/WaffleCMocka.cmake
@@ -23,11 +23,24 @@
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/third_party/cmocka")
+
set(cmocka_source_dir ${CMAKE_SOURCE_DIR}/third_party/cmocka)
+set(cmocka_build_dir ${CMAKE_SOURCE_DIR}/third_party/cmocka)
+
+include(ConfigureChecks)
+add_definitions(-DHAVE_CONFIG_H=1)
+configure_file(
+ ${cmocka_source_dir}/config.h.cmake
+ ${cmocka_build_dir}/config.h
+)
list(APPEND CMOCKA_SOURCES
${cmocka_source_dir}/src/cmocka.c
)
add_library(cmocka STATIC ${cmocka_source_dir}/src/cmocka.c)
-target_include_directories(cmocka PUBLIC ${cmocka_source_dir}/include)
+target_include_directories(cmocka PUBLIC
+ ${cmocka_source_dir}/include
+ ${cmocka_build_dir}
+)
diff --git a/cmake/Modules/WaffleDefineCompilerFlags.cmake b/cmake/Modules/WaffleDefineCompilerFlags.cmake
index 679d09c..d39ff45 100644
--- a/cmake/Modules/WaffleDefineCompilerFlags.cmake
+++ b/cmake/Modules/WaffleDefineCompilerFlags.cmake
@@ -126,7 +126,7 @@ if(waffle_on_linux)
add_definitions(-DWAFFLE_HAS_TLS_MODEL_INITIAL_EXEC)
endif()
- add_definitions(-D_XOPEN_SOURCE=600)
+ add_definitions(-D_XOPEN_SOURCE=700)
endif()
if(waffle_has_nacl)
--
2.6.2
More information about the waffle
mailing list