forked from lcompilers/lpython
-
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.
Switch to CMake build system for lfortran runtime
- Loading branch information
Showing
2 changed files
with
42 additions
and
8 deletions.
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,38 @@ | ||
cmake_minimum_required(VERSION 3.5 FATAL_ERROR) | ||
|
||
project(lfort C) | ||
|
||
if (NOT CMAKE_BUILD_TYPE) | ||
set(CMAKE_BUILD_TYPE Debug | ||
CACHE STRING "Build type (Debug, Release)" FORCE) | ||
endif () | ||
if (NOT (CMAKE_BUILD_TYPE STREQUAL "Debug" OR | ||
CMAKE_BUILD_TYPE STREQUAL "Release")) | ||
message("${CMAKE_BUILD_TYPE}") | ||
message(FATAL_ERROR "CMAKE_BUILD_TYPE must be one of: Debug, Release (current value: '${CMAKE_BUILD_TYPE}')") | ||
endif () | ||
|
||
enable_testing() | ||
|
||
message("\n") | ||
message("Configuration results") | ||
message("---------------------") | ||
message("C compiler : ${CMAKE_C_COMPILER}") | ||
message("Build type: ${CMAKE_BUILD_TYPE}") | ||
if (CMAKE_BUILD_TYPE STREQUAL "Debug") | ||
message("C compiler flags : ${CMAKE_C_FLAGS_DEBUG}") | ||
else () | ||
message("C compiler flags : ${CMAKE_C_FLAGS_RELEASE}") | ||
endif () | ||
message("Installation prefix: ${CMAKE_INSTALL_PREFIX}") | ||
|
||
|
||
set(SRC | ||
lfort_intrinsics.c | ||
) | ||
add_library(lfortran ${SRC}) | ||
install(TARGETS lfortran | ||
RUNTIME DESTINATION bin | ||
ARCHIVE DESTINATION share/lfortran/lib | ||
LIBRARY DESTINATION share/lfortran/lib | ||
) |
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