aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2018-06-13 12:38:28 +0200
committerClifford Wolf <clifford@clifford.at>2018-06-13 12:38:28 +0200
commit145c849596bdcd24f3b4e617eeb4ee06e1b93452 (patch)
tree243d63251d31498f4e92bfdae3ae0d0f087f9957 /CMakeLists.txt
parent4d7f18dd98a7ef9540a279a8e27cb9dbef355af7 (diff)
parentde0918c28758b09f638e02ffc04fad989321da1b (diff)
downloadnextpnr-145c849596bdcd24f3b4e617eeb4ee06e1b93452.tar.gz
nextpnr-145c849596bdcd24f3b4e617eeb4ee06e1b93452.tar.bz2
nextpnr-145c849596bdcd24f3b4e617eeb4ee06e1b93452.zip
Merge branch 'master' of gitlab.com:SymbioticEDA/nextpnr
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt22
1 files changed, 14 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b0976d9a..74a94ae4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -79,36 +79,42 @@ aux_source_directory(frontend/json/ JSON_PARSER_FILES)
set(COMMON_FILES ${COMMON_SRC_FILES} ${JSON_PARSER_FILES})
set(CMAKE_BUILD_TYPE Debug)
+if(MINGW)
+ add_definitions("-Wa,-mbig-obj")
+endif(MINGW)
+
foreach (family ${FAMILIES})
string(TOUPPER ${family} ufamily)
aux_source_directory(${family}/ ${ufamily}_FILES)
+ aux_source_directory(tests/${family}/ ${ufamily}_TEST_FILES)
# Add the CLI binary target
add_executable(nextpnr-${family} ${COMMON_FILES} ${${ufamily}_FILES} ${GUI_SOURCE_FILES})
+ target_compile_definitions(nextpnr-${family} PRIVATE MAIN_EXECUTABLE)
+
# Add the importable Python module target
PYTHON_ADD_MODULE(nextpnrpy_${family} ${COMMON_FILES} ${${ufamily}_FILES})
- target_compile_definitions(nextpnrpy_${family} PRIVATE PYTHON_MODULE)
# Add any new per-architecture targets here
+ add_executable(nextpnr-${family}-test ${${ufamily}_TEST_FILES} ${COMMON_FILES} ${${ufamily}_FILES})
+ target_link_libraries(nextpnr-${family}-test PRIVATE gtest_main)
+ add_test(${family}-test ${CMAKE_CURRENT_BINARY_DIR}/nextpnr-${family}-test)
+
# Set ${family_targets} to the list of targets being build for this family
- set(family_targets nextpnr-${family} nextpnrpy_${family})
+ set(family_targets nextpnr-${family} nextpnrpy_${family} nextpnr-${family}-test)
# Include the family-specific CMakeFile
include(${family}/family.cmake)
foreach (target ${family_targets})
# Include family-specific source files to all family targets and set defines appropriately
target_include_directories(${target} PRIVATE ${family}/)
- target_compile_definitions(${target} PRIVATE NEXTPNR_NAMESPACE=nextpnr_${family} ARCH_${ufamily} ARCHNAME=${family} -DQT_NO_KEYWORDS)
+ target_compile_definitions(${target} PRIVATE NEXTPNR_NAMESPACE=nextpnr_${family} ARCH_${ufamily} ARCHNAME=${family} QT_NO_KEYWORDS)
target_link_libraries(${target} LINK_PUBLIC ${Boost_LIBRARIES} ${PYTHON_LIBRARIES} ${GUI_LIBRARY_FILES})
endforeach (target)
-
- add_executable(nextpnr-${family}-test "")
- target_sources(nextpnr-${family}-test PRIVATE tests/${family}/main.cpp)
- target_link_libraries(nextpnr-${family}-test PRIVATE gtest_main)
- add_test(${family}-test ${CMAKE_CURRENT_BINARY_DIR}/nextpnr-${family}-test)
endforeach (family)
file(GLOB_RECURSE CLANGFORMAT_FILES *.cc *.h)
string(REGEX REPLACE "[^;]*/ice40/chipdbs/chipdb-[^;]*.cc" "" CLANGFORMAT_FILES "${CLANGFORMAT_FILES}")
string(REGEX REPLACE "[^;]*/3rdparty[^;]*" "" CLANGFORMAT_FILES "${CLANGFORMAT_FILES}")
+string(REGEX REPLACE "[^;]*/generated[^;]*" "" CLANGFORMAT_FILES "${CLANGFORMAT_FILES}")
add_custom_target(
clangformat