Skip to content

Commit

Permalink
build: Move intx::int128 definition to main CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast committed Jun 17, 2020
1 parent 0b9809b commit 7d9457b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ if(INTX_FUZZING)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${fuzzing_flags}")
endif()


set(INTX_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/include)

add_library(int128 INTERFACE)
add_library(intx::int128 ALIAS int128)
target_compile_features(int128 INTERFACE cxx_std_14)
target_sources(int128 INTERFACE $<BUILD_INTERFACE:${INTX_INCLUDE_DIR}/intx/int128.hpp>)
target_include_directories(int128 INTERFACE $<BUILD_INTERFACE:${INTX_INCLUDE_DIR}>$<INSTALL_INTERFACE:include>)


add_subdirectory(lib/intx)

if(INTX_TESTING)
Expand Down
9 changes: 0 additions & 9 deletions lib/intx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@
# Copyright 2019-2020 Pawel Bylica.
# Licensed under the Apache License, Version 2.0.

set(INTX_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/include)

add_library(int128 INTERFACE)
add_library(intx::int128 ALIAS int128)
target_compile_features(int128 INTERFACE cxx_std_14)
target_sources(int128 INTERFACE $<BUILD_INTERFACE:${INTX_INCLUDE_DIR}/intx/int128.hpp>)
target_include_directories(int128 INTERFACE $<BUILD_INTERFACE:${INTX_INCLUDE_DIR}>$<INSTALL_INTERFACE:include>)


add_library(intx STATIC
${INTX_INCLUDE_DIR}/intx/intx.hpp
impl.cpp
Expand Down

0 comments on commit 7d9457b

Please sign in to comment.