Skip to content

Commit

Permalink
Updated module build files for revised cmake-project templates
Browse files Browse the repository at this point in the history
  • Loading branch information
martinbond7 committed Oct 15, 2024
1 parent 36b2fad commit 99435e7
Show file tree
Hide file tree
Showing 41 changed files with 119 additions and 241 deletions.
25 changes: 20 additions & 5 deletions examples/13_modules/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,40 @@ add_compile_definitions(
)

# TODO: uncomment the following target modules directive when
# working with modules
# working with example modules

# add_library(modules OBJECT
# src/MeasurementType.ixx
# src/Measurement.ixx
# src/Measurements.ixx
# )

# add_library(modules OBJECT
# src/alarm.ixx
# src/constraints.ixx
# src/templates.ixx
# )

# add_library(modules OBJECT
# src/morning.ixx
# src/evening.ixx
# )

# add_library(modules OBJECT
# src/alarm-base.ixx
# src/alarm-helper.ixx
# src/alarm-extra.ixx
# src/alarm.ixx
# )

add_library(modules OBJECT
src/alarm.ixx
src/handler.ixx
)
# add_library(modules OBJECT
# src/alarm.ixx
# src/handler.ixx
# )

# add_library(modules OBJECT
# src/greet.ixx
# )

if (TARGET modules)
target_include_directories(modules PRIVATE
Expand Down
20 changes: 20 additions & 0 deletions examples/13_modules/alarm-partitions/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
cmake_minimum_required(VERSION 3.21)
project(target-system LANGUAGES C CXX)

add_library(modules OBJECT
${PROJECT_SOURCE_DIR}/alarm-base.ixx
${PROJECT_SOURCE_DIR}/alarm-helper.ixx
${PROJECT_SOURCE_DIR}/alarm-extra.ixx
${PROJECT_SOURCE_DIR}/alarm.ixx
)

target_include_directories(modules PRIVATE
${CMAKE_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}/include
)

if (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
target_compile_options(modules PRIVATE
-xc++
)
endif()
18 changes: 18 additions & 0 deletions examples/13_modules/alarm/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
cmake_minimum_required(VERSION 3.21)
project(target-system LANGUAGES C CXX)

add_library(modules OBJECT
${PROJECT_SOURCE_DIR}/alarm.ixx
${PROJECT_SOURCE_DIR}/handler.ixx
)

target_include_directories(modules PRIVATE
${CMAKE_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}/include
)

if (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
target_compile_options(modules PRIVATE
-xc++
)
endif()
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
68 changes: 0 additions & 68 deletions examples/13_modules/cmake-alarm/CMakeLists.txt

This file was deleted.

74 changes: 0 additions & 74 deletions examples/13_modules/cmake-alarm/CMakePresets.json

This file was deleted.

17 changes: 17 additions & 0 deletions examples/13_modules/greet/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
cmake_minimum_required(VERSION 3.21)
project(target-system LANGUAGES C CXX)

add_library(modules OBJECT
${PROJECT_SOURCE_DIR}/greet.ixx
)

target_include_directories(modules PRIVATE
${CMAKE_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}/include
)

if (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
target_compile_options(modules PRIVATE
-xc++
)
endif()
File renamed without changes.
File renamed without changes.
File renamed without changes.
18 changes: 18 additions & 0 deletions examples/13_modules/morning/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
cmake_minimum_required(VERSION 3.21)
project(target-system LANGUAGES C CXX)

add_library(modules OBJECT
${PROJECT_SOURCE_DIR}/morning.ixx
${PROJECT_SOURCE_DIR}/evening.ixx
)

target_include_directories(modules PRIVATE
${CMAKE_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}/include
)

if (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
target_compile_options(modules PRIVATE
-xc++
)
endif()
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 0 additions & 4 deletions examples/13_modules/src-alarm-partitions/Modules.txt

This file was deleted.

3 changes: 0 additions & 3 deletions examples/13_modules/src-alarm/Modules.txt

This file was deleted.

26 changes: 0 additions & 26 deletions examples/13_modules/src-alarm/alarm.cpp

This file was deleted.

20 changes: 0 additions & 20 deletions examples/13_modules/src-alarm/alarm.ixx

This file was deleted.

11 changes: 0 additions & 11 deletions examples/13_modules/src-alarm/handler.cpp

This file was deleted.

7 changes: 0 additions & 7 deletions examples/13_modules/src-alarm/handler.ixx

This file was deleted.

16 changes: 0 additions & 16 deletions examples/13_modules/src-alarm/main.cpp

This file was deleted.

19 changes: 19 additions & 0 deletions examples/13_modules/templates/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
cmake_minimum_required(VERSION 3.21)
project(target-system LANGUAGES C CXX)

add_library(modules OBJECT
${PROJECT_SOURCE_DIR}/alarm.ixx
${PROJECT_SOURCE_DIR}/constraints.ixx
${PROJECT_SOURCE_DIR}/templates.ixx
)

target_include_directories(modules PRIVATE
${CMAKE_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}/include
)

if (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
target_compile_options(modules PRIVATE
-xc++
)
endif()
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 99435e7

Please sign in to comment.