Skip to content

Modernize CMakeLists.txt and a few Windows specific fixes#3663

Merged
jcking merged 1 commit intoantlr:devfrom
hs-apotell:multiconf
Apr 19, 2022
Merged

Modernize CMakeLists.txt and a few Windows specific fixes#3663
jcking merged 1 commit intoantlr:devfrom
hs-apotell:multiconf

Conversation

@hs-apotell
Copy link
Collaborator

Modernize CMakeLists.txt and a few Windows specific fixes

  • Upgraded to minimum version 3.15 (was 3.14)
  • Use CMAKE_MSVC_RUNTIME_LIBRARY to configure CRT
  • Use target_compile_definitions to configure definitions so they can selectively be propagated upward (ANTLR4CPP_EXPORTS & ANTLR4CPP_STATIC needed to be propagated upwards)
  • Handle CRT requirement for test correctly (gtest configuration should depend on WITH_STATIC_CRT)
  • Don't change the default CMake output directory. With multiple configurations CMake doesn't trigger a build when the configuration is switched resulting in link errors (debug linking against release or vice-versa).
  • Rename the static pdb file the same as the library (this was a conflict with both static and shared attempting to write to the same pdb file)
  • Fixed x86 targets (definition of MurmurHash::update was missing)
  • Updated CMakeSettings.json to build within project directory hierarchy rather than in user profile directory (the latter used to be VS default)

Signed-off-by: HS hs@apotell.com

* Upgraded to minimum version 3.15 (was 3.14)
* Use CMAKE_MSVC_RUNTIME_LIBRARY to configure CRT
* Use target_compile_definitions to configure definitions so they can
selectively be propagated upward (ANTLR4CPP_EXPORTS & ANTLR4CPP_STATIC
needed to be propagated upwards)
* Handle CRT requirement for test correctly (gtest configuration should
depend on WITH_STATIC_CRT)
* Don't change the default CMake output directory. With multiple
configurations CMake doesn't trigger a build when the configuration is
switched resulting in link errors (debug linking against release or
vice-versa).
* Rename the static pdb file the same as the library (this was a
conflict with both static and shared attempting to write to the same pdb
file)
* Fixed x86 targets (definition of MurmurHash::update was missing)
* Updated CMakeSettings.json to build within project directory hierarchy
rather than in user profile directory (the latter used to be VS default)

Signed-off-by: HS <hs@apotell.com>
@jcking jcking merged commit b973b42 into antlr:dev Apr 19, 2022
@hs-apotell hs-apotell deleted the multiconf branch April 25, 2022 06:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants