Mercurial > pub > dyncall > dyncall
diff CMakeLists.txt @ 149:c12120a1fbc0
- make cmake based builds work on systems without a C++ compiler (thanks Franklin Mathieu)
author | cslag |
---|---|
date | Sat, 17 Sep 2016 14:10:53 +0200 |
parents | 6e7b1b7ad9d3 |
children | 3cb226f48495 |
line wrap: on
line diff
--- a/CMakeLists.txt Sun Sep 11 01:19:27 2016 +0200 +++ b/CMakeLists.txt Sat Sep 17 14:10:53 2016 +0200 @@ -19,7 +19,7 @@ # cmake_minimum_required (VERSION 2.6) -project(DynCall) +project(DynCall C) set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "dyncall enables dynamic invocation of machine-level function calls") set(CPACK_PACKAGE_VENDOR "dyncall project") @@ -35,6 +35,11 @@ # currently we have no use for this, but maybe later.. #set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/buildsys/cmake/Modules" "${CMAKE_MODULE_PATH}") +option(LANG_CXX "Enable and build C++ tests" ON) + +if(LANG_CXX) + enable_language(CXX) +endif() if(MSVC) enable_language(ASM_MASM) @@ -61,7 +66,7 @@ set(CMAKE_ASM_COMPILER_ARG1 "${CPPFLAGS} -c") enable_language(ASM) else() - if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + if (CMAKE_C_COMPILER_ID STREQUAL "Clang") add_definitions("-fPIC") # enable gcc as front-end to assembler for .S files set(CMAKE_ASM_COMPILER "${CMAKE_C_COMPILER}")