Support pure C compiler build

This commit is contained in:
Hui Yu
2025-06-07 16:44:48 +08:00
parent 4b28e80080
commit 035dea4918
2 changed files with 4 additions and 7 deletions

View File

@@ -1,9 +1,6 @@
cmake_minimum_required (VERSION 2.6...3.10.2) cmake_minimum_required (VERSION 2.6...3.10.2)
project (CGenerator C) project (CGenerator C)
enable_language(C)
enable_language(CXX)
cmake_policy(SET CMP0063 NEW) cmake_policy(SET CMP0063 NEW)
set(CMAKE_C_VISIBILITY_PRESET default) set(CMAKE_C_VISIBILITY_PRESET default)

View File

@@ -1,5 +1,5 @@
include(CheckCXXSymbolExists) include(CheckSymbolExists)
check_cxx_symbol_exists(strndup "string.h" HAVE_STRNDUP) check_symbol_exists(strndup "string.h" HAVE_STRNDUP)
check_cxx_symbol_exists(secure_getenv "stdlib.h" HAVE_SECURE_GETENV) check_symbol_exists(secure_getenv "stdlib.h" HAVE_SECURE_GETENV)
check_cxx_symbol_exists(getenv "stdlib.h" HAVE_GETENV) check_symbol_exists(getenv "stdlib.h" HAVE_GETENV)