Skip to content

Commit

Permalink
build: CMakeLists.txt Do not use private makefile targets (fluent#5819)
Browse files Browse the repository at this point in the history
$< is a private detail from the Makefile generated by CMakefile and id
not under control or to be used at the CMakeLists level. In CMake 3.20
that private generation changed pre-requisite targets[1] and now logs
contain the path compiler_depend.ts instead of the actual file.

Signed-off-by: Paulo Neves <[email protected]>

Signed-off-by: Paulo Neves <[email protected]>
  • Loading branch information
ptsneves authored Aug 11, 2022
1 parent 1aae936 commit fc32552
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 17 deletions.
6 changes: 1 addition & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,7 @@ else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
endif()

if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__='\"$(subst ${CMAKE_SOURCE_DIR}/,,$(abspath $<))\"'")
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__=__FILE__")
endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__=__FILE__")

if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "armv7l")
set(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -latomic")
Expand Down
7 changes: 1 addition & 6 deletions lib/chunkio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@ else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall ")
endif()

# Set __FILENAME__
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__='\"$(subst ${CMAKE_SOURCE_DIR}/,,$(abspath $<))\"'")
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__=__FILE__")
endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__=__FILE__")

include(cmake/macros.cmake)

Expand Down
7 changes: 1 addition & 6 deletions lib/cmetrics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,7 @@ set(CMT_VERSION_MINOR 3)
set(CMT_VERSION_PATCH 5)
set(CMT_VERSION_STR "${CMT_VERSION_MAJOR}.${CMT_VERSION_MINOR}.${CMT_VERSION_PATCH}")

# Define __FILENAME__ consistently across Operating Systems
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__='\"$(subst ${CMAKE_SOURCE_DIR}/,,$(abspath $<))\"'")
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__=__FILE__")
endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__=__FILE__")

# Configuration options
option(CMT_DEV "Enable development mode" No)
Expand Down

0 comments on commit fc32552

Please sign in to comment.