-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
For Windows, we need to avoid cross-compiling using the configure script, because it will link with more gnulib modules than is supported. gnulib's fcntl.c module breaks --output-sync (NDK bug 1492). Instead, mimic build_w32.bat by: - building the same list of C files - copying the same gnulib headers - reusing the same config.h.W32.template file For Darwin, the host-cpu-c-abi gnulib module breaks universal builds, but it's easy to disable the module by editing config.h by hand afterwards. (Removing that module from bootstrap.conf and rerunning bootstrap might also be an option, but it changes a lot of stuff.) I created CMakeLists.txt by translating Android.bp manually. Bug: android/ndk#1492 Bug: android/ndk#1546 Change-Id: I367109233967ec6f0a1637b3ab262a234c93bc5b (cherry picked from commit 487fc28) Merged-In: I367109233967ec6f0a1637b3ab262a234c93bc5b
- Loading branch information
Showing
6 changed files
with
976 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
# Copyright 2021 The Android Open Source Project | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
project(make) | ||
cmake_minimum_required(VERSION 3.18.1) | ||
|
||
add_executable(make | ||
# make_SRCS | ||
src/ar.c | ||
src/arscan.c | ||
src/commands.c | ||
src/default.c | ||
src/dir.c | ||
src/expand.c | ||
src/file.c | ||
src/function.c | ||
src/getopt.c | ||
src/getopt1.c | ||
src/guile.c | ||
src/hash.c | ||
src/implicit.c | ||
src/job.c | ||
src/load.c | ||
src/loadapi.c | ||
src/main.c | ||
src/misc.c | ||
src/output.c | ||
src/read.c | ||
src/remake.c | ||
src/rule.c | ||
src/signame.c | ||
src/strcache.c | ||
src/variable.c | ||
src/version.c | ||
src/vpath.c | ||
|
||
# USE_CUSTOMS | ||
src/remote-stub.c | ||
) | ||
|
||
target_compile_definitions(make PRIVATE -DHAVE_CONFIG_H) | ||
target_include_directories(make PRIVATE lib src) | ||
|
||
if(UNIX) | ||
if(CMAKE_SYSTEM_NAME STREQUAL Linux) | ||
target_include_directories(make PRIVATE soong/linux_glibc) | ||
target_sources(make PRIVATE lib/getloadavg.c) | ||
target_link_libraries(make PRIVATE -ldl) | ||
elseif(APPLE) | ||
target_include_directories(make PRIVATE soong/darwin) | ||
endif() | ||
target_compile_definitions(make PRIVATE | ||
-DLOCALEDIR=NULL | ||
-DINCLUDEDIR=0 | ||
-DLIBDIR=0 | ||
) | ||
target_sources(make PRIVATE | ||
src/posixos.c | ||
lib/concat-filename.c | ||
lib/exitfail.c | ||
lib/fnmatch.c | ||
lib/findprog-in.c | ||
lib/glob.c | ||
lib/xalloc-die.c | ||
lib/xconcat-filename.c | ||
) | ||
endif() | ||
|
||
if(WIN32) | ||
target_include_directories(make PRIVATE | ||
soong/windows | ||
src/w32/include | ||
) | ||
target_compile_definitions(make PRIVATE -DWINDOWS32) | ||
target_sources(make PRIVATE | ||
src/w32/pathstuff.c | ||
src/w32/w32os.c | ||
src/w32/compat/posixfcn.c | ||
src/w32/subproc/misc.c | ||
src/w32/subproc/sub_proc.c | ||
src/w32/subproc/w32err.c | ||
lib/fnmatch.c | ||
lib/glob.c | ||
lib/getloadavg.c | ||
) | ||
endif() | ||
|
||
install(TARGETS make) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
This directory was generated by imitating these lines in build_w32.bat: | ||
|
||
if exist src\config.h.W32.template call :ConfigSCM | ||
copy src\config.h.W32 %OUTDIR%\src\config.h | ||
|
||
copy lib\glob.in.h %OUTDIR%\lib\glob.h | ||
copy lib\fnmatch.in.h %OUTDIR%\lib\fnmatch.h | ||
|
||
config.h.W32.template has strings like: | ||
|
||
%PACKAGE% | ||
%PACKAGE_VERSION% | ||
%VERSION% | ||
|
||
These need to be replaced with their real values. See the other config.h files | ||
for examples. |
Oops, something went wrong.